知乎防图片失败
// ==UserScript==
// @name 知乎防图片失败
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author 李恒道
// @match https://zhuanlan.zhihu.com/p/*
// @match https://zhuanlan.zhihu.com/write
// @icon https://www.google.com/s2/favicons?domain=zhihu.com
// @grant none
// @run-at document-start
// ==/UserScript==
let oldfetch = fetch;
function fuckfetch() {
return new Promise((resolve, reject) => {
oldfetch.apply(this, arguments).then(response => {
if(response.url==="https://zhuanlan.zhihu.com/api/uploaded_images"){
Object.defineProperty(response, 'status', {
value: 200,
writable: false
})
}
resolve(response);
});
});
}
window.fetch = fuckfetch;