Skip to content

Instantly share code, notes, and snippets.

@vermi321
Created September 23, 2023 13:36
Show Gist options
  • Save vermi321/3bab8c1d34650d60c31c9be6cf008e1d to your computer and use it in GitHub Desktop.
Save vermi321/3bab8c1d34650d60c31c9be6cf008e1d to your computer and use it in GitHub Desktop.
// ==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