MCPcopy Create free account
hub / github.com/XIU2/UserScript / switchHomeRecommend

Function switchHomeRecommend

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

Source from the content-addressed store, hash-verified

1648}
1649// 针对首页几个页面
1650function switchHomeRecommend() {
1651 document.querySelectorAll('header.AppHeader nav>a:not([target])[href="https://www.zhihu.com/"]').forEach((a)=>{a.addEventListener('click', function(e){e.preventDefault();document.cookie='tst=r; expires=Thu, 18 Dec 2099 12:00:00 GMT; domain=.zhihu.com; path=/';location.href=this.href;return false;})})
1652}
1653
1654(function() {
1655 if (window.onurlchange === undefined) {addUrlChangeEvent();} // Tampermonkey v4.11 版本添加的 onurlchange 事件 grant,可以监控 pjax 等网页的 URL 变化

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected