From 8b3189f1edfb8ad71267e51ee55a73c8e85044dd Mon Sep 17 00:00:00 2001 From: "Kuba (kb)" Date: Tue, 6 Feb 2024 17:18:49 +0100 Subject: [PATCH] fixYoutubeEmbeds - Support locales other than english (#2128) Co-authored-by: V --- src/plugins/fixYoutubeEmbeds.desktop/native.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/fixYoutubeEmbeds.desktop/native.ts b/src/plugins/fixYoutubeEmbeds.desktop/native.ts index 5a3ef2c6..5419d4ad 100644 --- a/src/plugins/fixYoutubeEmbeds.desktop/native.ts +++ b/src/plugins/fixYoutubeEmbeds.desktop/native.ts @@ -16,8 +16,9 @@ app.on("browser-window-created", (_, win) => { frame.executeJavaScript(` new MutationObserver(() => { - let err = document.querySelector(".ytp-error-content-wrap-subreason span")?.textContent; - if (err && err.includes("blocked it from display")) window.location.reload() + if( + document.querySelector('div.ytp-error-content-wrap-subreason a[href^="https://www.youtube.com/watch?v="]') + ) location.reload() }).observe(document.body, { childList: true, subtree:true }); `); }