MCPcopy Index your code
hub / github.com/XIU2/UserScript / forceTarget_

Function forceTarget_

Autopage.user.js:2469–2475  ·  view source on GitHub ↗
(target, e)

Source from the content-addressed store, hash-verified

2467 if (!d) return
2468
2469 function forceTarget_(target, e){
2470 if (target.href && target.target != '_blank' && !(target.getAttribute('onclick')) && target.href.slice(0,4) == 'http' && target.getAttribute('href').slice(0,1) != '#') {
2471 e.stopPropagation(); // 阻止冒泡(避免被父元素事件委托捕获)
2472 e.preventDefault(); // 阻止默认打开链接事件
2473 GM_openInTab(target.href, {active: true,insert: true,setParent: true});
2474 }
2475 }
2476 d.addEventListener('click', function(e) {
2477 //console.log(e.target.tagName, e.path)
2478 if (e.target.tagName === 'A') {

Callers 1

forceTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected