Created
September 23, 2023 13:36
-
-
Save vermi321/3bab8c1d34650d60c31c9be6cf008e1d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name DeBank stealth mode | |
// @namespace http://tampermonkey.net/ | |
// @version 0.7.0 | |
// @description DeBank tools | |
// @author vermi321 | |
// @match https://debank.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=debank.com | |
// @grant none | |
// ==/UserScript== | |
(async () => { | |
console.log(`Blocking /read enabled`); | |
const rawFetch = window.fetch; | |
window.fetch = async (...args) => { | |
const [url, options] = args; | |
if (url !== 'https://api.debank.com/article/read') { | |
return rawFetch(...args); | |
} | |
try { | |
const {id, source} = JSON.parse(options.body); | |
const idFromUrl = Number(window.location.pathname.split('/stream/')[1]); | |
if (source === 'detail' && idFromUrl === Number(id)) { | |
console.log(`Reading post ${id}`); | |
return rawFetch(...args); | |
} | |
} catch { | |
// | |
} | |
return new Promise(() => { | |
// just hang | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment