fixYoutubeEmbeds: fix when youtube decides to use http without s (#2155)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
Klen_list 2024-02-08 21:55:48 +03:00 committed by Luna
parent c4ef3869f2
commit 828688b996

View file

@ -17,7 +17,7 @@ app.on("browser-window-created", (_, win) => {
frame.executeJavaScript(` frame.executeJavaScript(`
new MutationObserver(() => { new MutationObserver(() => {
if( if(
document.querySelector('div.ytp-error-content-wrap-subreason a[href^="https://www.youtube.com/watch?v="]') document.querySelector('div.ytp-error-content-wrap-subreason a[href*="www.youtube.com/watch?v="]')
) location.reload() ) location.reload()
}).observe(document.body, { childList: true, subtree:true }); }).observe(document.body, { childList: true, subtree:true });
`); `);