Last active
April 30, 2023 22:35
-
-
Save ikeman2003/a12a38743882ad7138c72aa95e853560 to your computer and use it in GitHub Desktop.
Automatically enable Twitch Chat Resize experiment with FrankerFaceZ
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 AutoChatResize | |
// @namespace https://github.com/ikeman2003/UserscriptRepo | |
// @version 0.2.1 | |
// @description Auto enable Twitch Chat Resize experiment | |
// @author ikeman2003 (fork of th3an7 AutoWARP) | |
// @downloadURL https://raw.githubusercontent.com/ikeman2003/UserscriptRepo/main/Userscripts/Twitch/AutoChatResize.user.js | |
// @updateURL https://raw.githubusercontent.com/ikeman2003/UserscriptRepo/main/Userscripts/Twitch/AutoChatResize.user.js | |
// @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['e85998cd-a7b4-400e-8139-6b1aeab9b4c9'] != 'treatment') { | |
unsafeWindow.ffz.experiments.setTwitchOverride('e85998cd-a7b4-400e-8139-6b1aeab9b4c9', '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