example.com Links in New Tab
On example.com only, open links in a new tab. Demo for by-site browsing.
Opening the URL above in Ikun Browser asks you to install. Update checks use the same URL.
Matches
https://example.com/*https://www.example.com/*
Grants
none
Source
// ==UserScript==
// @name example.com 链接新窗口
// @name:zh-Hans example.com 链接新窗口
// @name:zh-Hant example.com 連結新視窗
// @name:en example.com Links in New Tab
// @name:ja example.com リンクを新しいタブで
// @name:ko example.com 링크 새 탭
// @name:id tautan example.com di Tab Baru
// @namespace https://scripts.ikunbrowser.com/demo/example-links
// @version 1.0.0
// @description 仅在 example.com 把页面链接改到新标签打开,用于「按站点」示例
// @description:zh-Hans 仅在 example.com 把页面链接改到新标签打开,用于「按站点」示例
// @description:zh-Hant 僅在 example.com 把頁面連結改到新分頁開啟,用於「依站點」示例
// @description:en On example.com only, open links in a new tab. Demo for by-site browsing.
// @description:ja example.com だけでリンクを新しいタブで開きます。サイト別一覧のデモです。
// @description:ko example.com에서만 링크를 새 탭으로 엽니다. 사이트별 목록 데모입니다.
// @description:id Hanya di example.com, buka tautan di tab baru. Demo daftar per situs.
// @author ikun
// @match https://example.com/*
// @match https://www.example.com/*
// @grant none
// @license MIT
// ==/UserScript==
(function () {
'use strict';
document.addEventListener(
'click',
function (ev) {
var a = ev.target && ev.target.closest ? ev.target.closest('a[href]') : null;
if (!a) return;
var href = a.getAttribute('href') || '';
if (!href || href.charAt(0) === '#' || href.indexOf('javascript:') === 0) return;
a.setAttribute('target', '_blank');
a.setAttribute('rel', 'noopener noreferrer');
},
true
);
})();