Prevent mini player above chat when stripping ads
This commit is contained in:
@@ -2,7 +2,7 @@ twitch-videoad.js text/javascript
|
|||||||
(function() {
|
(function() {
|
||||||
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
||||||
'use strict';
|
'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) {
|
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
|
||||||
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
||||||
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
||||||
@@ -925,6 +925,10 @@ twitch-videoad.js text/javascript
|
|||||||
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
||||||
postTwitchWorkerMessage('UpdateAuthorizationHeader', AuthorizationHeader = init.headers['Authorization']);
|
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')) {
|
if (ForceAccessTokenPlayerType && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
||||||
let replacedPlayerType = '';
|
let replacedPlayerType = '';
|
||||||
const newBody = JSON.parse(init.body);
|
const newBody = JSON.parse(init.body);
|
||||||
@@ -946,10 +950,6 @@ twitch-videoad.js text/javascript
|
|||||||
init.body = JSON.stringify(newBody);
|
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);
|
return realFetch.apply(this, arguments);
|
||||||
|
|||||||
+6
-6
@@ -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 34.0.0
|
// @version 35.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
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'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) {
|
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
|
||||||
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
console.log("skipping vaft as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
||||||
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
||||||
@@ -936,6 +936,10 @@
|
|||||||
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
||||||
postTwitchWorkerMessage('UpdateAuthorizationHeader', AuthorizationHeader = init.headers['Authorization']);
|
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')) {
|
if (ForceAccessTokenPlayerType && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
||||||
let replacedPlayerType = '';
|
let replacedPlayerType = '';
|
||||||
const newBody = JSON.parse(init.body);
|
const newBody = JSON.parse(init.body);
|
||||||
@@ -957,10 +961,6 @@
|
|||||||
init.body = JSON.stringify(newBody);
|
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);
|
return realFetch.apply(this, arguments);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
twitch-videoad.js text/javascript
|
twitch-videoad.js text/javascript
|
||||||
(function() {
|
(function() {
|
||||||
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
if ( /(^|\.)twitch\.tv$/.test(document.location.hostname) === false ) { return; }
|
||||||
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) {
|
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
|
||||||
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
||||||
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
||||||
@@ -685,6 +685,10 @@ twitch-videoad.js text/javascript
|
|||||||
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
||||||
postTwitchWorkerMessage('UpdateAuthorizationHeader', AuthorizationHeader = init.headers['Authorization']);
|
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 (OPT_FORCE_ACCESS_TOKEN_PLAYER_TYPE && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
if (OPT_FORCE_ACCESS_TOKEN_PLAYER_TYPE && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
||||||
let replacedPlayerType = '';
|
let replacedPlayerType = '';
|
||||||
const newBody = JSON.parse(init.body);
|
const newBody = JSON.parse(init.body);
|
||||||
@@ -706,10 +710,6 @@ twitch-videoad.js text/javascript
|
|||||||
init.body = JSON.stringify(newBody);
|
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);
|
return realFetch.apply(this, arguments);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name TwitchAdSolutions (video-swap-new)
|
// @name TwitchAdSolutions (video-swap-new)
|
||||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||||
// @version 1.53
|
// @version 1.54
|
||||||
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/video-swap-new/video-swap-new.user.js
|
// @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
|
// @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)
|
// @description Multiple solutions for blocking Twitch ads (video-swap-new)
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
(function() {
|
(function() {
|
||||||
'use strict';
|
'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) {
|
if (typeof window.twitchAdSolutionsVersion !== 'undefined' && window.twitchAdSolutionsVersion >= ourTwitchAdSolutionsVersion) {
|
||||||
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
console.log("skipping video-swap-new as there's another script active. ourVersion:" + ourTwitchAdSolutionsVersion + " activeVersion:" + window.twitchAdSolutionsVersion);
|
||||||
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
window.twitchAdSolutionsVersion = ourTwitchAdSolutionsVersion;
|
||||||
@@ -697,6 +697,10 @@
|
|||||||
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
if (typeof init.headers['Authorization'] === 'string' && init.headers['Authorization'] !== AuthorizationHeader) {
|
||||||
postTwitchWorkerMessage('UpdateAuthorizationHeader', AuthorizationHeader = init.headers['Authorization']);
|
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 (OPT_FORCE_ACCESS_TOKEN_PLAYER_TYPE && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
if (OPT_FORCE_ACCESS_TOKEN_PLAYER_TYPE && typeof init.body === 'string' && init.body.includes('PlaybackAccessToken')) {
|
||||||
let replacedPlayerType = '';
|
let replacedPlayerType = '';
|
||||||
const newBody = JSON.parse(init.body);
|
const newBody = JSON.parse(init.body);
|
||||||
@@ -718,10 +722,6 @@
|
|||||||
init.body = JSON.stringify(newBody);
|
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);
|
return realFetch.apply(this, arguments);
|
||||||
|
|||||||
Reference in New Issue
Block a user