You need to install this in the TamperMonkey extension.
This might break if your default language for Twitch is not English.
You can also change the desired quality by updating the desiredQuality
variable.
// ==UserScript== | |
// @name Force 1080p60 (Source) video quality on Twitch | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match *://*.twitch.tv/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// @author Antoine Delia | |
// ==/UserScript== | |
var desiredQuality = "1080p60 (Source)" | |
(function() { | |
'use strict'; | |
var nothing = setInterval(function() { | |
var settingsButton = document.querySelectorAll('[data-a-target="player-settings-button"]')[0]; | |
if (settingsButton == null) { | |
return | |
} | |
settingsButton.click(); | |
var divs = document.getElementsByTagName("div"); | |
var searchTextQuality = "Quality"; | |
var qualityFound; | |
for (var i = 0; i < divs.length; i++) { | |
if (divs[i].textContent == searchTextQuality) { | |
qualityFound = divs[i]; | |
qualityFound.click(); | |
var searchTextSource = desiredQuality; | |
var sourceFound; | |
for (var j = 0; j < divs.length; j++) { | |
if (divs[i].textContent == searchTextSource) { | |
sourceFound = divs[i]; | |
sourceFound.click(); | |
break; | |
} | |
} | |
break; | |
} | |
} | |
settingsButton.click(); | |
}, 10000); | |
})(); |