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 GitHub
parent 935d0a0a03
commit f1f0da4a9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 });
`); `);