sabjorn / BandcampEnhancementSuite

A Chrome Extension providing extra functionality for Bandcamp
MIT License
40 stars 3 forks source link

Firefox compatibility through script #138

Closed sabjorn closed 1 year ago

sabjorn commented 1 year ago

according this this: it may be possible to use a script to change the manifest from V3 to V2:

We have a MV3 extension that we’ve released for Chrome that we’re planning on releasing for Firefox soon. We actually dynamically generate the manifest with a small node script on build. We have something like this:

background: FIREFOX
? {
// Firefox doesn’t support `service_worker` yet
scripts: [“background.js”],
}
: {
service_worker: “background.js”,
},

So far, it is working just fine. We’re also using webextension-polyfill for all of the browser/extension communication.

sabjorn commented 1 year ago

nevermind: according to this on Jan 17 Firefox will be released with V3 compatibility!

sabjorn commented 1 year ago

we will need to add browser_specific_settings to manifest.json for Firefox to work: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings

sabjorn commented 1 year ago

started working on with: https://github.com/sabjorn/BandcampEnhancementSuite/tree/feat/firefox_manifest_v3

changes work on Chrome but currently not on Firefox (plugin loads BUT no indication that it's working)

sabjorn commented 1 year ago

CORS prevents getting waveforms, this might be necessary...

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#host_permissions

sabjorn commented 1 year ago

this has been uploaded via https://github.com/sabjorn/BandcampEnhancementSuite/tree/release-1.6.1 however, one problem remains. Firefox does not give you the permissions for CORS automatically (even though it's specified in the manifest).

This should have the key: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions

perhaps "permissions" will need to be added...

although this is nothing new and the lack of "prompting" for user permission acceptance may be just because my dev environment is weird...

sabjorn commented 1 year ago

looks like this is fine. closing unless other issues pop up. finished in 57e5dc2cc5f501d392f76cf37653dbb9d2c970c0