animal-crossing-music-extension / ac-music-extension

Google Chrome extension that plays hourly Animal Crossing music and more while browsing!
https://acmusicext.com
zlib License
343 stars 57 forks source link

Prevent the extension from crashing when MediaSession API is not supported #62

Closed jordigarcl closed 4 years ago

jordigarcl commented 4 years ago

Would close #58

TL;DR: We accidentally broke support for other browsers (like Opera) when we used the navigator.mediasession API. This PR introduces checks around those calls so as only make them when said API is supported, therefore preventing the extension from crashing.

Tested in (macOS):

Edited – tested in some more browsers:

Also, this is just a hotfix and does not fix the little glitches appearing e.g. in the icon badge. We should probably evaluate the extend of browser support.

jordigarcl commented 4 years ago

Please test this on Windows browsers. I wonder if we should have a "official" list of supported browsers so we can know what to test against.

jordigarcl commented 4 years ago

If we are to release this as a patch ASAP, we can already set it as 4.0.1and merge this directly into master (as a hotfix branch), then merge it to develop aswell.

PikaDude commented 4 years ago

IMO we'll go through develop first because there's a few other small things that I want to tinker with before the new patch. Additionally, a set list of browsers that we should test on before release sounds like a good idea. I was personally thinking:

I'll test this PR in all of these browsers in a few hours time.

jordigarcl commented 4 years ago

Tested the basic functionality in some more browsers, see PR description.