Closed raszpl closed 1 week ago
all 4 handled: https://github.com/code-charity/youtube/pull/2382 + implemented https://github.com/code-charity/youtube/issues/1976
Looks like Vivaldi bug or implementation quirk - it doesnt send pause event without explicit user input (click)? :/ Vivaldi fails to send 'pause' event and breaks here.
Fixed itself after restart. Might have been caused by disabling/enabling/restarting/reloading extension for two days straight in same browser session.
1. Its being called multiple times during page load, and in different order depending on browser! :o
FF:
Chrome:
Vivaldi:
Looks like Vivaldi bug or implementation quirk - it doesnt send pause event without explicit user input (click)? :/
Its wasteful, but thats a small fry. The problem is YT mutating page multiple times while loading. Here is a log of
player
andplayer.parentNode
from FF during consequent playerControls() calls:videoPageUpdate:
initPlayer:
videoPageUpdate:
playerOnPause:
player
stays the same, but playerControls() sets listeners onplayer.parentNode
, and that becomes the proper final element only on last playerOnPause call. Vivaldi fails to send 'pause' event and breaks here.Why is the code adding listeners on ImprovedTube.elements.player.parentNode player parent and not player itself?
2. it keeps adding new listeners on every pause
https://github.com/code-charity/youtube/blob/2bbf665a08704b5aeba467c4e55d9a940a9c87b3/js%26css/web-accessible/www.youtube.com/player.js#L996-L999 pause 10 times and you have 10 listeners doing same thing. Theoretically its possible to keep browsing videos with extension piling listeners until js engine gives up and browser crashes.
3.
core.js:160 Uncaught TypeError: ImprovedTube.whenPaused is not a function
https://github.com/code-charity/youtube/blob/2bbf665a08704b5aeba467c4e55d9a940a9c87b3/js%26css/web-accessible/core.js#L200-L202
some leftover code?
4.
Uncaught TypeError: player.showControls is not a function
https://github.com/code-charity/youtube/issues/2378 shows up in embeds because embeds dont have player controls :)