videospeed icon indicating copy to clipboard operation
videospeed copied to clipboard

"stopImmediatePropagation" interfering with other extensions (SponsorBlock)

Open ajayyy opened this issue 4 years ago • 6 comments

I've been getting a lot of reports about my extension breaking when using video speed. It seems to be caused by this line where it stops propagation of ratechange events, so my extension is not notified (as found by "@9732").

I've thought of two solutions, and I'm wondering what you think of them?

  1. Is this required on YouTube? From what I've heard, it is only required on twitch and some other sites. If so, maybe it could not happen if on YouTube.

  2. Maybe videospeed could create a custom event that other extensions could listen to

Anyone else have any other ideas?

ajayyy avatar Jul 03 '20 22:07 ajayyy

Both of those seem reasonable. How are you consuming or reacting to the event in your extension?

igrigorik avatar Jul 04 '20 22:07 igrigorik

The extension skips parts of a video at a specific time. It does so by setting a timeout until the skip time. It listens for the ratechange event to be able to reset the schedule as the skip now should happen at a different time.

Relevant code: https://github.com/ajayyy/SponsorBlock/blob/master/src/content.ts#L596

ajayyy avatar Jul 04 '20 22:07 ajayyy

Gotcha, ty. My intuition is that emitting a custom event might be a better route since that's site agnostic. Sounds like you'd be OK with that?

igrigorik avatar Jul 04 '20 22:07 igrigorik

Yep, that'd work for me

ajayyy avatar Jul 04 '20 23:07 ajayyy

Still facing issues. Previously I could fix by manually pausing after I change the video speed. Once I do a quick pause then unpause, sponsorblock would work again. But now it does not.

benjo456 avatar Apr 05 '22 09:04 benjo456

it isn't working for me either

Chrysanthemum536 avatar Aug 09 '22 05:08 Chrysanthemum536