From 7cd853fae1fcfa8a2f2d0e6515477cb4ff7f15a6 Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 4 Mar 2024 18:45:22 -0600 Subject: [PATCH] fix: Executing inside embedded players --- youtube2piped.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/youtube2piped.user.js b/youtube2piped.user.js index cbd11d1..0284ae6 100644 --- a/youtube2piped.user.js +++ b/youtube2piped.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name YouTube2Piped // @namespace YouTube -// @version 1.4.1 +// @version 1.4.2 // @description Redirect YouTube to chosen Piped instance // @author SinTan // @match *://*.youtube.com/* @@ -15,6 +15,12 @@ (function () { "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')) { exit; }