william-reed / Pipit-extension

The Chrome / Firefox companion extension for Pipit - bringing native macOS Picture in Picture to Chrome and Firefox for (almost) any video
1 stars 1 forks source link

Removed failure if cannot locate video element and fixed pausing for Twitch #1

Closed inickt closed 6 years ago

inickt commented 6 years ago

Dunno if I can clean this up any more but it works

william-reed commented 6 years ago

add missing semicolons on video.pause() as well as a URL check for containing twitch before double pausing - then its good to go

inickt commented 6 years ago

Why the specific check for Twitch? I haven't gone through all sites but it doesn't seem that unreasonable it could crop up somewhere else– and I don't really think it hurts.

william-reed commented 6 years ago

not in love with executing async code when not needed but I suppose your right. Looks like async/await was introduced in chrome 55 which was about 2 years ago so thats something to keep in mind but in all likelihood browsers will be updated past that anyway

inickt commented 6 years ago

I don't think I needed to use async here, but there is also no need for that bock to be synchronous. Luckily the delay needed is incredibly small, so we could pull it out of the async, but the pausing can technically happen whenever.

inickt commented 6 years ago

Also I don't think we have to worry about 55 anymore: https://www.w3counter.com/globalstats.php