rojer / a-s-minus

Awesome Screenshot Minus
102 stars 24 forks source link

Firefox Extension #49

Open trymeouteh opened 5 years ago

trymeouteh commented 5 years ago

Please add this extension for Firefox.

jkayani commented 5 years ago

Sure - since Firefox supports the WebExtension API, which is basically a standardization around the Chrome Extension API, this should be doable. It's just a matter of trying to run it in Firefox, seeing what breaks, and repeating the process until it all seems to work.

jkayani commented 5 years ago

After some tinkering, I've got some progress! Here's what currently doesn't work in Firefox:

Here's what I haven't tested, and don't plan to:

Everything else, including taking screenshots with visible area, selected area, and entire page, and saving screenshots locally and to Imgur, works. I had to replace some extension API calls that were deprecated with their modern equivalents, and I had to setup another set of API credentials for Imgur to work in Chrome and Firefox (since the redirect URLs are different in each browser, and the Imgur API allows 1 white-listed redirect URL per application).

So if there were to be a Firefox port of this extension, it'd certainly be missing the desktop capture functionality. The Google Drive stuff can be fixed, but it'd require manually doing the OAuth flow using the API that works in both browsers, chrome.identity.launchWebAuthFlow. This is fine, but will require a developer to setup a Google Drive API key, similar to the Imgur API setup. I currently have the Imgur API keys in my control, and would prefer not to - I think the project maintainer should be in their possession. Similarly, I'd prefer if he set up Google Drive API keys (one for Chrome, one for Firefox just like Imgur) for the extension to use.

Questions for @rojer:

@trymeouteh: If you wouldn't mind, can you try loading this version (https://github.com/jkayani/a-s-minus/tree/firefox-build) of the extension into Firefox to test it out? You can load extensions into Firefox through these instructions: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Temporary_Installation_in_Firefox