// ==UserScript== // @name 知乎去首页加载广告 // @namespace http://tampermonkey.net/ // @version 0.2 // @description try to take over the world! // @author You // @match https://www.zhihu.com/ // @match https://www.zhihu.com/search* // @icon https://www.google.com/s2/favicons?domain=zhihu.com // @grant none // @run-at document-start // ==/UserScript== var head = document.head || document.getElementsByTagName('head')[0]; var style = document.createElement('style'); style.type = 'text/css'; style.innerText='.App-main{overflow-x: hidden;}.Sticky .Pc-card{display:none;}header{background-color: #43a6e2 !important; color: white !important;}header div {border: 0px solid rgb(108, 67, 226) !important;}header .is-active{color: white !important;}' head.appendChild(style); let oldfetch=fetch function newobj(){} function fuckfetch(...bianliang){ return new Promise(function(resolve, reject){ oldfetch(...bianliang).then(function(response) { let handler = { get: function(target, prop, receiver) { if(typeof Reflect.get(target,prop)==='function') { if(Reflect.get(target,prop+'proxy')===undefined) { target[prop+'proxy']=(...funcargs)=> { let result=target[prop].call(target,...funcargs) if(bianliang.length!==0&&bianliang[0].indexOf('/api/v3/feed/topstory/recommend')!==-1&&prop==='json'){ return new Promise(function(resolve, reject){ result.then( function(data){ console.log('bianliang',bianliang) let retobj={ data:[], fresh_text:data.fresh_text, paging:data.paging, } for(let index=0;indexdiv') for(let index=0;index