Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions js&css/web-accessible/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ CODEC || 30FPS
----------------------------------------------------------------
Do not move, needs to be on top of first injected content
file to patch HTMLMediaElement before YT player uses it.

Patches are always installed so that toggling 60fps OFF or
codec blocking at runtime takes effect without a reload.
The overwrite() function reads localStorage fresh each call,
so activation is fully dynamic.
--------------------------------------------------------------*/
if (localStorage['it-codec'] || localStorage['it-player30fps']) {
(function () {
function overwrite(self, callback, mime) {
if (localStorage['it-codec']) {
var re = new RegExp(localStorage['it-codec']);
Expand All @@ -123,7 +128,7 @@ if (localStorage['it-codec'] || localStorage['it-player30fps']) {
HTMLMediaElement.prototype.canPlayType = function (mime) {
return overwrite(this, canPlayType, mime);
}
};
})();

/*--------------------------------------------------------------
# MESSAGES
Expand Down