Fix Brave Bug for YouTube Live Chat

To Fix Brave Bug for YouTube Live Chat

Δημιουργός
𝖢𝖸 𝖥𝗎𝗇𝗀
Ημερήσιες εγκαταστάσεις
0
Σύνολο εγκαταστάσεων
374
Βαθμολογίες
3 0 0
Έκδοση
3.31
Δημιουργήθηκε την
30/08/2023
Ενημερώθηκε την
29/10/2024
Άδεια
MIT
Εφαρμόζεται σε

This is to fix the bug for Brave. (YouTube Live Chat)

Target User: Brave

See https://community.brave.com/t/youtube-live-chat-30-sec-delay/

Root Cause

YouTube calls "urlChanged" twice to set the iframe url. In the first attempt, chatframe.contentDocument is null. So it will set the src of the iframe. In the second attempt, chatframe.contentDocument is non-null. So it will set the url using chatframe.contentDocument.location.replace

Both Brave and Chrome will do these two attempts. Both attempts are just 10ms aparted.

The difference is, in brave, the first attempt affected the second attempt, but in chrome, the first attempt would not affect the second attempt.

Details in Github issue#25694