From e73cb1efaea3a60aebfb73350bed845e324fbae3 Mon Sep 17 00:00:00 2001 From: Jacob Winters Date: Tue, 25 Feb 2025 21:02:15 +0000 Subject: [PATCH] Fix false positives in YouTube watch URL matching We don't want to match https://example.com/?url=https://www.youtube.com/watch? --- 153699.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/153699.user.js b/153699.user.js index 7cbb653..669d097 100644 --- a/153699.user.js +++ b/153699.user.js @@ -267,14 +267,14 @@ ytwp.isWatchUrl = function (url) { if (!url) url = uw.location.href; - if (url.match(/https?:\/\/(www\.)?youtube.com\/(c|channel|user)\/[^\/]+\/live/)) { + if (url.match(/^https?:\/\/(www\.)?youtube.com\/(c|channel|user)\/[^\/]+\/live/)) { if (document.querySelector('ytd-browse')) { return false } else { return true } } - return url.match(/https?:\/\/(www\.)?youtube.com\/watch\?/); + return url.match(/^https?:\/\/(www\.)?youtube.com\/watch\?/); }; ytwp.setTheaterMode = function(enable) {