Prevent mini player above chat when stripping ads

This commit is contained in:
pixeltris
2026-02-24 23:03:02 +00:00
parent 3d109ee68f
commit 91d83253ae
4 changed files with 22 additions and 22 deletions
+6 -6
View File
@@ -1,7 +1,7 @@
// ==UserScript==
// @name TwitchAdSolutions (vaft)
// @namespace https://github.com/pixeltris/TwitchAdSolutions
// @version 34.0.0
// @version 35.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';
const ourTwitchAdSolutionsVersion = 21;// Used to prevent conflicts with outdated versions of the scripts
const ourTwitchAdSolutionsVersion = 22;// Used to prevent conflicts with outdated versions of the scripts
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
@@ -936,6 +936,10 @@
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
postTwitchWorkerMessage('UpdateAuthorizationHeader', AuthorizationHeader = init.headers['Authorization']);
}
// Get rid of mini player above chat - TODO: Reject this locally instead of having server reject it
if (init && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken') && init.body.includes('picture-by-picture')) {
init.body = '';
}
if (ForceAccessTokenPlayerType && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
let replacedPlayerType = '';
const newBody = JSON.parse(init.body);
@@ -957,10 +961,6 @@
init.body = JSON.stringify(newBody);
}
}
// Get rid of mini player above chat - TODO: Reject this locally instead of having server reject it
if (init && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken') && init.body.includes('picture-by-picture')) {
init.body = '';
}
}
}
return realFetch.apply(this, arguments);