igrigorik / videospeed

HTML5 video speed controller (for Google Chrome)
https://chrome.google.com/webstore/detail/video-speed-controller/nffaoalbilbmmfgbnbgppjihopabppdk
MIT License
3.74k stars 529 forks source link

"stopImmediatePropagation" interfering with other extensions (SponsorBlock) #683

Open ajayyy opened 4 years ago

ajayyy commented 4 years ago

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?

igrigorik commented 4 years ago

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

ajayyy commented 4 years ago

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

igrigorik commented 4 years ago

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?

ajayyy commented 4 years ago

Yep, that'd work for me

benjo456 commented 2 years ago

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.

Chrysanthemum536 commented 1 year ago

it isn't working for me either