Created
June 9, 2022 07:44
-
-
Save th3an7/0d851dc19db6511d71aaf4f02713403d to your computer and use it in GitHub Desktop.
Automatically enable Twitch WARP experiment with FrankerFaceZ
This file contains 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 AutoWARP | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Auto enable Twitch WARP experiment | |
// @author Th3Ant | |
// @match https://www.twitch.tv/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitch.tv | |
// @grant unsafeWindow | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function waitForFFZ() { | |
setTimeout(function() { | |
if (unsafeWindow.ffz == undefined) { | |
console.log('Waiting...'); | |
waitForFFZ(); | |
} | |
else { | |
if (unsafeWindow.ffz.experiments.Cookie.getJSON().experiment_overrides.experiments['e5c813df-a190-4def-b0cb-932224c989f1'] != 'treatment') { | |
unsafeWindow.ffz.experiments.setTwitchOverride('e5c813df-a190-4def-b0cb-932224c989f1', 'treatment'); | |
console.log('Experiment enabled - reloading webpage...'); | |
location.reload(); | |
} | |
else { | |
console.log('Experiment already enabled...'); | |
return; | |
} | |
} | |
}, 1000) | |
} | |
document.addEventListener('load', waitForFFZ()); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment