-
-
Save ikeman2003/83cf3ea14f22d070fbc2c59bd4e91244 to your computer and use it in GitHub Desktop.
Automatically enable Twitch Chat History 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 AutoChatHistory | |
// @namespace https://github.com/ikeman2003/UserscriptRepo | |
// @version 0.2.4 | |
// @description Auto enable Twitch Chat History experiment | |
// @author ikeman2003 (fork of th3an7 AutoWARP) | |
// @downloadURL https://raw.githubusercontent.com/ikeman2003/UserscriptRepo/main/Userscripts/Twitch/AutoChatHistory.user.js | |
// @updateURL https://raw.githubusercontent.com/ikeman2003/UserscriptRepo/main/Userscripts/Twitch/AutoChatHistory.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('[AutoChatHistory] Waiting...'); | |
waitForFFZ(); | |
} else { | |
if (unsafeWindow.ffz.experiments.Cookie.getJSON().experiment_overrides.experiments['994869b7-223b-4d34-b30c-46b403d6468b'] != 'treatment') { | |
unsafeWindow.ffz.experiments.setTwitchOverride('994869b7-223b-4d34-b30c-46b403d6468b', 'treatment'); | |
console.log('[AutoChatHistory] Experiment enabled - reloading webpage...'); | |
location.reload(); | |
} else { | |
console.log('[AutoChatHistory] 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