您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Opens Youtube video links in new tab
当前为
// ==UserScript== // @name Open Youtube video links in new tab // @description Opens Youtube video links in new tab // @version 1.0.1 // @license MIT License // @include https://www.youtube.com/* // @exclude https://www.youtube.com/watch* // @grant GM_openInTab // @run-at document-start // @require https://greasyfork.org/scripts/12228/code/setMutationHandler.js // @namespace https://greasyfork.org/users/14346 // ==/UserScript== attachHandler([].slice.call(document.getElementsByTagName('a'))); setMutationHandler(document, 'a[href^="/watch"]', function(nodes) { attachHandler(nodes); return true; }); function attachHandler(nodes) { nodes.forEach(function(node) { if (node.target != '_blank') { node.onclick = clickHandler; node.addEventListener('click', clickHandler); } }); } function clickHandler(e) { if (e.button > 1) return; e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); GM_openInTab(this.href, e.button || e.ctrlKey); }