@@ -1,7 +1,7 @@
|
||||
twitch-videoad.js text/javascript
|
||||
(function() {
|
||||
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
||||
var ourTwitchAdSolutionsVersion = 4;// 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 = 5;// 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;
|
||||
@@ -846,7 +846,7 @@ twitch-videoad.js text/javascript
|
||||
}
|
||||
async function handleWorkerFetchRequest(fetchRequest) {
|
||||
try {
|
||||
const response = await window.fetch(fetchRequest.url, fetchRequest.options);
|
||||
const response = await window.realFetch(fetchRequest.url, fetchRequest.options);
|
||||
const responseBody = await response.text();
|
||||
const responseObject = {
|
||||
id: fetchRequest.id,
|
||||
@@ -865,6 +865,7 @@ twitch-videoad.js text/javascript
|
||||
}
|
||||
function hookFetch() {
|
||||
var realFetch = window.fetch;
|
||||
window.realFetch = realFetch;
|
||||
window.fetch = function(url, init, ...args) {
|
||||
if (typeof url === 'string') {
|
||||
//Check if squad stream.
|
||||
|
||||
+4
-3
@@ -1,7 +1,7 @@
|
||||
// ==UserScript==
|
||||
// @name TwitchAdSolutions (vaft)
|
||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||
// @version 19.0.0
|
||||
// @version 20.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
|
||||
@@ -13,7 +13,7 @@
|
||||
// ==/UserScript==
|
||||
(function() {
|
||||
'use strict';
|
||||
var ourTwitchAdSolutionsVersion = 4;// 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 = 5;// 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;
|
||||
@@ -858,7 +858,7 @@
|
||||
}
|
||||
async function handleWorkerFetchRequest(fetchRequest) {
|
||||
try {
|
||||
const response = await window.fetch(fetchRequest.url, fetchRequest.options);
|
||||
const response = await window.realFetch(fetchRequest.url, fetchRequest.options);
|
||||
const responseBody = await response.text();
|
||||
const responseObject = {
|
||||
id: fetchRequest.id,
|
||||
@@ -877,6 +877,7 @@
|
||||
}
|
||||
function hookFetch() {
|
||||
var realFetch = window.fetch;
|
||||
window.realFetch = realFetch;
|
||||
window.fetch = function(url, init, ...args) {
|
||||
if (typeof url === 'string') {
|
||||
//Check if squad stream.
|
||||
|
||||
Reference in New Issue
Block a user