Created
August 13, 2025 18:13
-
-
Save insin/48ad60824dcf85e4d72eb1e3a1819831 to your computer and use it in GitHub Desktop.
Disable a feature flag on Twitter
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
let $reactRoot = document.querySelector('#react-root') | |
let wrapped = $reactRoot.firstElementChild.wrappedJSObject || $reactRoot.firstElementChild | |
let reactPropsKey = Object.keys(wrapped).find(key => key.startsWith('__reactProps')) | |
let featureSwitches = wrapped[reactPropsKey].children?.props?.children?.props?.contextProviderProps?.featureSwitches | |
let isTrue = featureSwitches.isTrue | |
featureSwitches.isTrue = (flag) => { | |
if (flag == 'rweb_age_assurance_flow_enabled') return false | |
return isTrue(flag) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment