ユーザースクリプトコマンドに「新しいタブでリンク先を開く」を追加
当前为
// ==UserScript==
// @name Open In New Tab
// @namespace https://greasyfork.org/users/1009-kengo321
// @version 1
// @description ユーザースクリプトコマンドに「新しいタブでリンク先を開く」を追加
// @grant GM_registerMenuCommand
// @match *://*/*
// @license MIT
// ==/UserScript==
if (window.self === window.top) {
GM_registerMenuCommand('新しいタブでリンク先を開く', function() {
;[].filter.call(document.links, function(e) {
return e.protocol !== 'javascript:' && !e.target
}).forEach(function(e) {
e.target = '_blank'
})
})
}