mirror of
https://github.com/pixeltris/TwitchAdSolutions.git
synced 2025-04-29 22:24:29 +02:00
Fix stream url detection in vaft
- Also remove unused code https://github.com/brave/adblock-resources/pull/160#discussion_r1576077411
This commit is contained in:
parent
5cb3c6c754
commit
02447140c7
@ -43,15 +43,6 @@ twitch-videoad.js text/javascript
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
//Send settings updates to worker.
|
|
||||||
window.addEventListener('message', (event) => {
|
|
||||||
if (event.source != window) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.data.type && event.data.type == 'SetTwitchAdblockSettings' && event.data.settings) {
|
|
||||||
TwitchAdblockSettings = event.data.settings;
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
function declareOptions(scope) {
|
function declareOptions(scope) {
|
||||||
scope.AdSignifier = 'stitched';
|
scope.AdSignifier = 'stitched';
|
||||||
scope.ClientID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';
|
scope.ClientID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';
|
||||||
@ -73,10 +64,6 @@ twitch-videoad.js text/javascript
|
|||||||
scope.AuthorizationHeader = null;
|
scope.AuthorizationHeader = null;
|
||||||
}
|
}
|
||||||
declareOptions(window);
|
declareOptions(window);
|
||||||
var TwitchAdblockSettings = {
|
|
||||||
BannerVisible: true,
|
|
||||||
ForcedQuality: null,
|
|
||||||
};
|
|
||||||
var twitchWorkers = [];
|
var twitchWorkers = [];
|
||||||
var adBlockDiv = null;
|
var adBlockDiv = null;
|
||||||
var OriginalVideoPlayerQuality = null;
|
var OriginalVideoPlayerQuality = null;
|
||||||
@ -102,7 +89,6 @@ twitch-videoad.js text/javascript
|
|||||||
${tryNotifyTwitch.toString()}
|
${tryNotifyTwitch.toString()}
|
||||||
${parseAttributes.toString()}
|
${parseAttributes.toString()}
|
||||||
declareOptions(self);
|
declareOptions(self);
|
||||||
self.TwitchAdblockSettings = ${JSON.stringify(TwitchAdblockSettings)};
|
|
||||||
self.addEventListener('message', function(e) {
|
self.addEventListener('message', function(e) {
|
||||||
if (e.data.key == 'UpdateIsSquadStream') {
|
if (e.data.key == 'UpdateIsSquadStream') {
|
||||||
IsSquadStream = e.data.value;
|
IsSquadStream = e.data.value;
|
||||||
@ -127,9 +113,6 @@ twitch-videoad.js text/javascript
|
|||||||
twitchWorkers.push(this);
|
twitchWorkers.push(this);
|
||||||
this.onmessage = function(e) {
|
this.onmessage = function(e) {
|
||||||
if (e.data.key == 'ShowAdBlockBanner') {
|
if (e.data.key == 'ShowAdBlockBanner') {
|
||||||
if (!TwitchAdblockSettings.BannerVisible) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (adBlockDiv == null) {
|
if (adBlockDiv == null) {
|
||||||
adBlockDiv = getAdBlockDiv();
|
adBlockDiv = getAdBlockDiv();
|
||||||
}
|
}
|
||||||
@ -264,7 +247,7 @@ twitch-videoad.js text/javascript
|
|||||||
var realFetch = fetch;
|
var realFetch = fetch;
|
||||||
fetch = async function(url, options) {
|
fetch = async function(url, options) {
|
||||||
if (typeof url === 'string') {
|
if (typeof url === 'string') {
|
||||||
if (url.includes('video-weaver')) {
|
if (url.endsWith('m3u8')) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var processAfter = async function(response) {
|
var processAfter = async function(response) {
|
||||||
//Here we check the m3u8 for any ads and also try fallback player types if needed.
|
//Here we check the m3u8 for any ads and also try fallback player types if needed.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name TwitchAdSolutions (vaft)
|
// @name TwitchAdSolutions (vaft)
|
||||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||||
// @version 7.0.0
|
// @version 8.0.0
|
||||||
// @description Multiple solutions for blocking Twitch ads (vaft)
|
// @description Multiple solutions for blocking Twitch ads (vaft)
|
||||||
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
||||||
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/vaft/vaft.user.js
|
||||||
@ -55,15 +55,6 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
//Send settings updates to worker.
|
|
||||||
window.addEventListener('message', (event) => {
|
|
||||||
if (event.source != window) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.data.type && event.data.type == 'SetTwitchAdblockSettings' && event.data.settings) {
|
|
||||||
TwitchAdblockSettings = event.data.settings;
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
function declareOptions(scope) {
|
function declareOptions(scope) {
|
||||||
scope.AdSignifier = 'stitched';
|
scope.AdSignifier = 'stitched';
|
||||||
scope.ClientID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';
|
scope.ClientID = 'kimne78kx3ncx6brgo4mv6wki5h1ko';
|
||||||
@ -85,10 +76,6 @@
|
|||||||
scope.AuthorizationHeader = null;
|
scope.AuthorizationHeader = null;
|
||||||
}
|
}
|
||||||
declareOptions(window);
|
declareOptions(window);
|
||||||
var TwitchAdblockSettings = {
|
|
||||||
BannerVisible: true,
|
|
||||||
ForcedQuality: null,
|
|
||||||
};
|
|
||||||
var twitchWorkers = [];
|
var twitchWorkers = [];
|
||||||
var adBlockDiv = null;
|
var adBlockDiv = null;
|
||||||
var OriginalVideoPlayerQuality = null;
|
var OriginalVideoPlayerQuality = null;
|
||||||
@ -114,7 +101,6 @@
|
|||||||
${tryNotifyTwitch.toString()}
|
${tryNotifyTwitch.toString()}
|
||||||
${parseAttributes.toString()}
|
${parseAttributes.toString()}
|
||||||
declareOptions(self);
|
declareOptions(self);
|
||||||
self.TwitchAdblockSettings = ${JSON.stringify(TwitchAdblockSettings)};
|
|
||||||
self.addEventListener('message', function(e) {
|
self.addEventListener('message', function(e) {
|
||||||
if (e.data.key == 'UpdateIsSquadStream') {
|
if (e.data.key == 'UpdateIsSquadStream') {
|
||||||
IsSquadStream = e.data.value;
|
IsSquadStream = e.data.value;
|
||||||
@ -139,9 +125,6 @@
|
|||||||
twitchWorkers.push(this);
|
twitchWorkers.push(this);
|
||||||
this.onmessage = function(e) {
|
this.onmessage = function(e) {
|
||||||
if (e.data.key == 'ShowAdBlockBanner') {
|
if (e.data.key == 'ShowAdBlockBanner') {
|
||||||
if (!TwitchAdblockSettings.BannerVisible) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (adBlockDiv == null) {
|
if (adBlockDiv == null) {
|
||||||
adBlockDiv = getAdBlockDiv();
|
adBlockDiv = getAdBlockDiv();
|
||||||
}
|
}
|
||||||
@ -276,7 +259,7 @@
|
|||||||
var realFetch = fetch;
|
var realFetch = fetch;
|
||||||
fetch = async function(url, options) {
|
fetch = async function(url, options) {
|
||||||
if (typeof url === 'string') {
|
if (typeof url === 'string') {
|
||||||
if (url.includes('video-weaver')) {
|
if (url.endsWith('m3u8')) {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
var processAfter = async function(response) {
|
var processAfter = async function(response) {
|
||||||
//Here we check the m3u8 for any ads and also try fallback player types if needed.
|
//Here we check the m3u8 for any ads and also try fallback player types if needed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user