youtube-webos icon indicating copy to clipboard operation
youtube-webos copied to clipboard

Sponsorblock chapters support

Open Informatic opened this issue 3 years ago • 4 comments

Fixes #8

Segments still disappear randomly, we likely have some race we need to fix up.

Informatic avatar Dec 24 '21 22:12 Informatic

Question: why are you polling the DOM for the progress bar instead of using a MutationObserver? You already use one in another part of your code and it is natively supported by the lowest WebOS chromium you support.

Additionally, I found an infinite loop which keeps hitting console.info('bringing back segments overlay'); when I try to use the cursor to click on the progress bar. Highlighted element is what n and this.segmentsoverlay is set to in the infinite loop. Verifiable with magic cursor and with PC mouse in Chrome inspector.

image

fire332 avatar Dec 29 '21 05:12 fire332

Yeah - that is a fairly good point. Mostly because I originally didn't use MutationObservers, and added support for that only when it turned out to be actually important. Want to take a stab at this? Otherwise, I hope to be able to find some time to clean this up before new year.

Informatic avatar Dec 29 '21 06:12 Informatic

I'll take a look at it but my current suspicion is that whatever they're using for their virtual DOM doesn't like scripts externally modifying what it controls.

fire332 avatar Dec 29 '21 15:12 fire332

Heh, I wasn't even aware there could be any virtual DOM implementation that wouldn't discard every element that's not under their control.

Informatic avatar Dec 29 '21 15:12 Informatic