Skip to content

Instantly share code, notes, and snippets.

@knowlet
Created May 12, 2023 20:08
Show Gist options
  • Save knowlet/1f7597937bbc5e3127c4fa69749823e0 to your computer and use it in GitHub Desktop.
Save knowlet/1f7597937bbc5e3127c4fa69749823e0 to your computer and use it in GitHub Desktop.
爆漿公社...
// ==UserScript==
// @name 無限爆漿
// @namespace https://knowlet.me
// @version 0.1
// @description try to take over the world!
// @author knowlet
// @match https://www.fans17.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=www.fans17.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Bypass DevTools Check
const console_log = window.console.log;
window.console.log = () => {};
window.onload = () => {
window.console.log = console_log;
};
// Intercept fetch
const originalFetch = window.fetch;
window.fetch = function(input, init) {
return originalFetch(input, init)
.then(response => {
const contentType = response.headers.get("content-type");
if (contentType && contentType.includes("application/json")) {
return response.clone().json()
.then(json => {
if (json.items) {
json.items = json.items.map(item => {
if (item.isLocked) {
item.isLocked = false;
}
return item;
});
}
return new Response(JSON.stringify(json), response);
});
} else {
return response;
}
});
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment