mirror of
https://github.com/pixeltris/TwitchAdSolutions.git
synced 2025-04-29 14:14:36 +02:00
Remove potential conflict with misc extensions
This commit is contained in:
parent
29a3cdccc8
commit
ac04e98d61
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name TwitchAdSolutions
|
// @name TwitchAdSolutions
|
||||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||||
// @version 1.8
|
// @version 1.9
|
||||||
// @description Multiple solutions for blocking Twitch ads
|
// @description Multiple solutions for blocking Twitch ads
|
||||||
// @author pixeltris
|
// @author pixeltris
|
||||||
// @match *://*.twitch.tv/*
|
// @match *://*.twitch.tv/*
|
||||||
@ -576,8 +576,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSeek) {
|
if (isSeek) {
|
||||||
console.log('Force seek to reset player (hopefully fixing any audio desync)');
|
console.log('Force seek to reset player (hopefully fixing any audio desync) pos:' + player.getPosition() + ' range:' + JSON.stringify(player.getBuffered()));
|
||||||
|
var pos = player.getPosition();
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
|
player.seekTo(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPausePlay) {
|
if (isPausePlay) {
|
||||||
@ -607,17 +609,21 @@
|
|||||||
function onContentLoaded() {
|
function onContentLoaded() {
|
||||||
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
||||||
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
||||||
Object.defineProperty(document, 'visibilityState', {
|
try {
|
||||||
get() {
|
Object.defineProperty(document, 'visibilityState', {
|
||||||
return 'visible';
|
get() {
|
||||||
}
|
return 'visible';
|
||||||
});
|
}
|
||||||
Object.defineProperty(document, 'hidden', {
|
});
|
||||||
get() {
|
}catch{}
|
||||||
return false;
|
try {
|
||||||
}
|
Object.defineProperty(document, 'hidden', {
|
||||||
});
|
get() {
|
||||||
const block = e => {
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch{}
|
||||||
|
var block = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
@ -626,19 +632,21 @@
|
|||||||
document.addEventListener('webkitvisibilitychange', block, true);
|
document.addEventListener('webkitvisibilitychange', block, true);
|
||||||
document.addEventListener('mozvisibilitychange', block, true);
|
document.addEventListener('mozvisibilitychange', block, true);
|
||||||
document.addEventListener('hasFocus', block, true);
|
document.addEventListener('hasFocus', block, true);
|
||||||
if (/Firefox/.test(navigator.userAgent)) {
|
try {
|
||||||
Object.defineProperty(document, 'mozHidden', {
|
if (/Firefox/.test(navigator.userAgent)) {
|
||||||
get() {
|
Object.defineProperty(document, 'mozHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
Object.defineProperty(document, 'webkitHidden', {
|
} else {
|
||||||
get() {
|
Object.defineProperty(document, 'webkitHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
||||||
onContentLoaded();
|
onContentLoaded();
|
||||||
|
@ -567,8 +567,10 @@ twitch-videoad.js application/javascript
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSeek) {
|
if (isSeek) {
|
||||||
console.log('Force seek to reset player (hopefully fixing any audio desync)');
|
console.log('Force seek to reset player (hopefully fixing any audio desync) pos:' + player.getPosition() + ' range:' + JSON.stringify(player.getBuffered()));
|
||||||
|
var pos = player.getPosition();
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
|
player.seekTo(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPausePlay) {
|
if (isPausePlay) {
|
||||||
@ -598,17 +600,21 @@ twitch-videoad.js application/javascript
|
|||||||
function onContentLoaded() {
|
function onContentLoaded() {
|
||||||
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
||||||
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
||||||
Object.defineProperty(document, 'visibilityState', {
|
try {
|
||||||
get() {
|
Object.defineProperty(document, 'visibilityState', {
|
||||||
return 'visible';
|
get() {
|
||||||
}
|
return 'visible';
|
||||||
});
|
}
|
||||||
Object.defineProperty(document, 'hidden', {
|
});
|
||||||
get() {
|
}catch{}
|
||||||
return false;
|
try {
|
||||||
}
|
Object.defineProperty(document, 'hidden', {
|
||||||
});
|
get() {
|
||||||
const block = e => {
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch{}
|
||||||
|
var block = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
@ -617,19 +623,21 @@ twitch-videoad.js application/javascript
|
|||||||
document.addEventListener('webkitvisibilitychange', block, true);
|
document.addEventListener('webkitvisibilitychange', block, true);
|
||||||
document.addEventListener('mozvisibilitychange', block, true);
|
document.addEventListener('mozvisibilitychange', block, true);
|
||||||
document.addEventListener('hasFocus', block, true);
|
document.addEventListener('hasFocus', block, true);
|
||||||
if (/Firefox/.test(navigator.userAgent)) {
|
try {
|
||||||
Object.defineProperty(document, 'mozHidden', {
|
if (/Firefox/.test(navigator.userAgent)) {
|
||||||
get() {
|
Object.defineProperty(document, 'mozHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
Object.defineProperty(document, 'webkitHidden', {
|
} else {
|
||||||
get() {
|
Object.defineProperty(document, 'webkitHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
||||||
onContentLoaded();
|
onContentLoaded();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name TwitchAdSolutions (notify-reload)
|
// @name TwitchAdSolutions (notify-reload)
|
||||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||||
// @version 1.8
|
// @version 1.9
|
||||||
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
|
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
|
||||||
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
|
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-reload/notify-reload.user.js
|
||||||
// @description Multiple solutions for blocking Twitch ads (notify-reload)
|
// @description Multiple solutions for blocking Twitch ads (notify-reload)
|
||||||
@ -578,8 +578,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSeek) {
|
if (isSeek) {
|
||||||
console.log('Force seek to reset player (hopefully fixing any audio desync)');
|
console.log('Force seek to reset player (hopefully fixing any audio desync) pos:' + player.getPosition() + ' range:' + JSON.stringify(player.getBuffered()));
|
||||||
|
var pos = player.getPosition();
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
|
player.seekTo(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPausePlay) {
|
if (isPausePlay) {
|
||||||
@ -609,17 +611,21 @@
|
|||||||
function onContentLoaded() {
|
function onContentLoaded() {
|
||||||
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
||||||
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
||||||
Object.defineProperty(document, 'visibilityState', {
|
try {
|
||||||
get() {
|
Object.defineProperty(document, 'visibilityState', {
|
||||||
return 'visible';
|
get() {
|
||||||
}
|
return 'visible';
|
||||||
});
|
}
|
||||||
Object.defineProperty(document, 'hidden', {
|
});
|
||||||
get() {
|
}catch{}
|
||||||
return false;
|
try {
|
||||||
}
|
Object.defineProperty(document, 'hidden', {
|
||||||
});
|
get() {
|
||||||
const block = e => {
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch{}
|
||||||
|
var block = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
@ -628,19 +634,21 @@
|
|||||||
document.addEventListener('webkitvisibilitychange', block, true);
|
document.addEventListener('webkitvisibilitychange', block, true);
|
||||||
document.addEventListener('mozvisibilitychange', block, true);
|
document.addEventListener('mozvisibilitychange', block, true);
|
||||||
document.addEventListener('hasFocus', block, true);
|
document.addEventListener('hasFocus', block, true);
|
||||||
if (/Firefox/.test(navigator.userAgent)) {
|
try {
|
||||||
Object.defineProperty(document, 'mozHidden', {
|
if (/Firefox/.test(navigator.userAgent)) {
|
||||||
get() {
|
Object.defineProperty(document, 'mozHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
Object.defineProperty(document, 'webkitHidden', {
|
} else {
|
||||||
get() {
|
Object.defineProperty(document, 'webkitHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
||||||
onContentLoaded();
|
onContentLoaded();
|
||||||
|
@ -567,8 +567,10 @@ twitch-videoad.js application/javascript
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSeek) {
|
if (isSeek) {
|
||||||
console.log('Force seek to reset player (hopefully fixing any audio desync)');
|
console.log('Force seek to reset player (hopefully fixing any audio desync) pos:' + player.getPosition() + ' range:' + JSON.stringify(player.getBuffered()));
|
||||||
|
var pos = player.getPosition();
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
|
player.seekTo(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPausePlay) {
|
if (isPausePlay) {
|
||||||
@ -598,17 +600,21 @@ twitch-videoad.js application/javascript
|
|||||||
function onContentLoaded() {
|
function onContentLoaded() {
|
||||||
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
||||||
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
||||||
Object.defineProperty(document, 'visibilityState', {
|
try {
|
||||||
get() {
|
Object.defineProperty(document, 'visibilityState', {
|
||||||
return 'visible';
|
get() {
|
||||||
}
|
return 'visible';
|
||||||
});
|
}
|
||||||
Object.defineProperty(document, 'hidden', {
|
});
|
||||||
get() {
|
}catch{}
|
||||||
return false;
|
try {
|
||||||
}
|
Object.defineProperty(document, 'hidden', {
|
||||||
});
|
get() {
|
||||||
const block = e => {
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch{}
|
||||||
|
var block = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
@ -617,19 +623,21 @@ twitch-videoad.js application/javascript
|
|||||||
document.addEventListener('webkitvisibilitychange', block, true);
|
document.addEventListener('webkitvisibilitychange', block, true);
|
||||||
document.addEventListener('mozvisibilitychange', block, true);
|
document.addEventListener('mozvisibilitychange', block, true);
|
||||||
document.addEventListener('hasFocus', block, true);
|
document.addEventListener('hasFocus', block, true);
|
||||||
if (/Firefox/.test(navigator.userAgent)) {
|
try {
|
||||||
Object.defineProperty(document, 'mozHidden', {
|
if (/Firefox/.test(navigator.userAgent)) {
|
||||||
get() {
|
Object.defineProperty(document, 'mozHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
Object.defineProperty(document, 'webkitHidden', {
|
} else {
|
||||||
get() {
|
Object.defineProperty(document, 'webkitHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
||||||
onContentLoaded();
|
onContentLoaded();
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name TwitchAdSolutions (notify-strip)
|
// @name TwitchAdSolutions (notify-strip)
|
||||||
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
// @namespace https://github.com/pixeltris/TwitchAdSolutions
|
||||||
// @version 1.8
|
// @version 1.9
|
||||||
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
|
// @updateURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
|
||||||
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
|
// @downloadURL https://github.com/pixeltris/TwitchAdSolutions/raw/master/notify-strip/notify-strip.user.js
|
||||||
// @description Multiple solutions for blocking Twitch ads (notify-strip)
|
// @description Multiple solutions for blocking Twitch ads (notify-strip)
|
||||||
@ -578,8 +578,10 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isSeek) {
|
if (isSeek) {
|
||||||
console.log('Force seek to reset player (hopefully fixing any audio desync)');
|
console.log('Force seek to reset player (hopefully fixing any audio desync) pos:' + player.getPosition() + ' range:' + JSON.stringify(player.getBuffered()));
|
||||||
|
var pos = player.getPosition();
|
||||||
player.seekTo(0);
|
player.seekTo(0);
|
||||||
|
player.seekTo(pos);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (isPausePlay) {
|
if (isPausePlay) {
|
||||||
@ -609,17 +611,21 @@
|
|||||||
function onContentLoaded() {
|
function onContentLoaded() {
|
||||||
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
// This stops Twitch from pausing the player when in another tab and an ad shows.
|
||||||
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
// Taken from https://github.com/saucettv/VideoAdBlockForTwitch/blob/cefce9d2b565769c77e3666ac8234c3acfe20d83/chrome/content.js#L30
|
||||||
Object.defineProperty(document, 'visibilityState', {
|
try {
|
||||||
get() {
|
Object.defineProperty(document, 'visibilityState', {
|
||||||
return 'visible';
|
get() {
|
||||||
}
|
return 'visible';
|
||||||
});
|
}
|
||||||
Object.defineProperty(document, 'hidden', {
|
});
|
||||||
get() {
|
}catch{}
|
||||||
return false;
|
try {
|
||||||
}
|
Object.defineProperty(document, 'hidden', {
|
||||||
});
|
get() {
|
||||||
const block = e => {
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}catch{}
|
||||||
|
var block = e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
@ -628,19 +634,21 @@
|
|||||||
document.addEventListener('webkitvisibilitychange', block, true);
|
document.addEventListener('webkitvisibilitychange', block, true);
|
||||||
document.addEventListener('mozvisibilitychange', block, true);
|
document.addEventListener('mozvisibilitychange', block, true);
|
||||||
document.addEventListener('hasFocus', block, true);
|
document.addEventListener('hasFocus', block, true);
|
||||||
if (/Firefox/.test(navigator.userAgent)) {
|
try {
|
||||||
Object.defineProperty(document, 'mozHidden', {
|
if (/Firefox/.test(navigator.userAgent)) {
|
||||||
get() {
|
Object.defineProperty(document, 'mozHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
} else {
|
});
|
||||||
Object.defineProperty(document, 'webkitHidden', {
|
} else {
|
||||||
get() {
|
Object.defineProperty(document, 'webkitHidden', {
|
||||||
return false;
|
get() {
|
||||||
}
|
return false;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
}catch{}
|
||||||
}
|
}
|
||||||
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
if (document.readyState === "complete" || document.readyState === "loaded" || document.readyState === "interactive") {
|
||||||
onContentLoaded();
|
onContentLoaded();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user