Skip to content

Commit

Permalink
Update TwitchAdSolutions scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbr committed Jan 24, 2025
1 parent 8949ec1 commit 3dd55aa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions resources/vaft-ublock-origin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
var ourTwitchAdSolutionsVersion = 1;// Only bump this when there's a breaking change to Twitch, the script, or there's a conflict with an unmaintained extension which uses this script
var ourTwitchAdSolutionsVersion = 2;// Only bump this when there's a breaking change to Twitch, the script, or there's a conflict with an unmaintained extension which uses this script
if (window.twitchAdSolutionsVersion && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
Expand Down Expand Up @@ -33,7 +33,8 @@
var IsPlayerAutoQuality = null;
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -46,7 +47,8 @@
// This is because their script ignores the incoming blob (our script) and replaces it with their own importScripts call
// To fix this we scoop out TwitchNoSub and re-insert it so that it inherits from our worker
var workerStringReinsert = [
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
function getCleanWorker(worker) {
var root = null;
Expand Down
8 changes: 5 additions & 3 deletions resources/video-swap-new-ublock-origin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function() {
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
var ourTwitchAdSolutionsVersion = 1;// Only bump this when there's a breaking change to Twitch, the script, or there's a conflict with an unmaintained extension which uses this script
var ourTwitchAdSolutionsVersion = 2;// Only bump this when there's a breaking change to Twitch, the script, or there's a conflict with an unmaintained extension which uses this script
if (window.twitchAdSolutionsVersion && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
Expand Down Expand Up @@ -32,7 +32,8 @@
var twitchWorkers = [];
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -45,7 +46,8 @@
// This is because their script ignores the incoming blob (our script) and replaces it with their own importScripts call
// To fix this we scoop out TwitchNoSub and re-insert it so that it inherits from our worker
var workerStringReinsert = [
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
function getCleanWorker(worker) {
var root = null;
Expand Down

0 comments on commit 3dd55aa

Please sign in to comment.