fix: Executing inside embedded players

This commit is contained in:
Sayantan Santra 2024-03-04 18:45:22 -06:00
parent 8500554a2d
commit 7cd853fae1
Signed by: SinTan1729
GPG Key ID: EB3E68BFBA25C85F
1 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name YouTube2Piped // @name YouTube2Piped
// @namespace YouTube // @namespace YouTube
// @version 1.4.1 // @version 1.4.2
// @description Redirect YouTube to chosen Piped instance // @description Redirect YouTube to chosen Piped instance
// @author SinTan // @author SinTan
// @match *://*.youtube.com/* // @match *://*.youtube.com/*
@ -15,6 +15,12 @@
(function () { (function () {
"use strict"; "use strict";
// Do not execute inside embedded players
if (window.location !== window.parent.location) {
exit;;
}
// Use #no-piped as an escape term
if (location.href.endsWith('#no-piped')) { if (location.href.endsWith('#no-piped')) {
exit; exit;
} }