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

Function directLink

Zhihu-Enhanced.user.js:1571–1573  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1569
1570// 默认站外直链,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码)
1571function directLink () {
1572 document.querySelectorAll('a.external[href*="link.zhihu.com/?target="], a.LinkCard[href*="link.zhihu.com/?target="]:not(.MCNLinkCard):not(.ZVideoLinkCard):not(.ADLinkCardContainer)').forEach(function (_this) {_this.href = decodeURIComponent(_this.href.substring(_this.href.indexOf('link.zhihu.com/?target=') + 23));});
1573}
1574
1575
1576// 默认折叠邀请,修改自:https://greasyfork.org/scripts/402808(从 JQuery 改为原生 JavaScript,且精简、优化了代码)

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected