Created
December 6, 2023 03:55
-
-
Save adryd325/14285bc8db06adcd0ccf6be999a46243 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 Feature Switches | |
// @namespace Violentmonkey Scripts | |
// @version 0.1 | |
// @description Feature Switches | |
// @author adryd | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function initialStatePatcher() { | |
let initialState = {} | |
Object.defineProperty(window, "__INITIAL_STATE__", { | |
set: function set(value) { | |
initialState = value | |
initialState.featureSwitch.debug = Object.assign({}, value.featureSwitch.user.config); | |
}, | |
get: function get() { | |
return initialState | |
}, | |
configurable: true | |
}) | |
} | |
const script = document.createElement("script") | |
script.text = "(" + initialStatePatcher.toString()+")()" | |
document.documentElement.appendChild(script); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment