Skip to content

Commit

Permalink
Fix conflict with latest TwitchNoSub
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris committed Jan 23, 2025
1 parent 8a9a25a commit b3bd44e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
8 changes: 5 additions & 3 deletions vaft/vaft-ublock-origin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
twitch-videoad.js text/javascript
(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 @@ -34,7 +34,8 @@ twitch-videoad.js text/javascript
var IsPlayerAutoQuality = null;
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -47,7 +48,8 @@ twitch-videoad.js text/javascript
// 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
10 changes: 6 additions & 4 deletions vaft/vaft.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name TwitchAdSolutions (vaft)
// @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 15.0.0
// @version 16.0.0
// @description Multiple solutions for blocking Twitch ads (vaft)
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
Expand All @@ -13,7 +13,7 @@
// ==/UserScript==
(function() {
'use strict';
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 @@ -46,7 +46,8 @@
var IsPlayerAutoQuality = null;
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -59,7 +60,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 video-swap-new/video-swap-new-ublock-origin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
twitch-videoad.js text/javascript
(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 @@ -33,7 +33,8 @@ twitch-videoad.js text/javascript
var twitchWorkers = [];
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -46,7 +47,8 @@ twitch-videoad.js text/javascript
// 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
10 changes: 6 additions & 4 deletions video-swap-new/video-swap-new.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name TwitchAdSolutions (video-swap-new)
// @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 1.33
// @version 1.34
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/video-swap-new/video-swap-new.user.js
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/video-swap-new/video-swap-new.user.js
// @description Multiple solutions for blocking Twitch ads (video-swap-new)
Expand All @@ -13,7 +13,7 @@
// ==/UserScript==
(function() {
'use strict';
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 @@ -45,7 +45,8 @@
var twitchWorkers = [];
var workerStringConflicts = [
'twitch',
'isVariantA'// TwitchNoSub
'isVariantA',// TwitchNoSub
'besuper/'// TwitchNoSub (0.9)
];
var workerStringAllow = [];
//
Expand All @@ -58,7 +59,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 b3bd44e

Please sign in to comment.