pes10k / web-api-manager

(Unmaintained) WebExtension based browser extension to manage and block untrusted parts of the Web API.
GNU General Public License v3.0
102 stars 16 forks source link

Differences in Chrome vs Firefox handling of tabs.query #52

Closed pes10k closed 6 years ago

pes10k commented 6 years ago

Firefox returns a Promise, Chrome wants a callback, need to figure out a way to account for both.

pes10k commented 6 years ago

fixed with 098a2a0

ghostwords commented 6 years ago

Firefox should works with callbacks too.

As a porting aid, the Firefox implementation of WebExtensions supports chrome, using callbacks, as well as browser, using promises. This means that many Chrome extensions will just work in Firefox without any changes. However, this is not part of the WebExtensions standard, and might not be supported by all compliant browsers.

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities

pes10k commented 6 years ago

Ah, interesting! I didn't know! I'm going to keep to the Promise API (w/ an exception for Chrome) in case other browsers get to the point where WexExtensions work equally as well, but good to know about this. Thanks for the pointer :)