Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial work for Firefox and Edge extensions #14

Closed
sean-roberts opened this issue Dec 16, 2016 · 18 comments
Closed

Initial work for Firefox and Edge extensions #14

sean-roberts opened this issue Dec 16, 2016 · 18 comments

Comments

@sean-roberts
Copy link
Contributor

sean-roberts commented Dec 16, 2016

With the new extensions API, we can now consolidate and ship firefox and edge extensions along side our chrome.

I have worked through getting local versions of the extensions up and running. There are a few checks and balances that are checked when uploading to the addon/extension stores but those offer very explicit changes if any. Here are the things we need to do to get the extensions up and running:

Firefox seems to support the extension as is but had an issue with our incognito mode setting. They require "spanning".

Edge is still missing support for some features.

Edge is not supporting the chrome namespace so we can add two things to support this:

  "-ms-preload": {
    "backgroundScript": "backgroundScriptsAPIBridge.js",
    "contentScript": "contentScriptsAPIBridge.js"
  },
  • Add var chrome = root.chrome || root.browser || root.msBrowser; to extension aware scripts (extension.bundle.js and embed.js)

Edge is not liking some stuff as well:

chromeBrowserAction.setBadgeText({tabId: tabId, text: badgeText});
chromeBrowserAction.setIcon({tabId: tabId, path: activeIcon});
chromeBrowserAction.setTitle({tabId: tabId, title: title});

list of chrome compatibility diffs if needed:

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Chrome_incompatibilities
https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/guides/porting-chrome-extensions/

edge api support:
https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/extensions/api-support/supported-apis/

Ideally, we can also upgrade our build process to make having three extensions easier to manage - but definitely a follow up

@judell
Copy link

judell commented Dec 17, 2016

This is excellent news, thanks @sean-roberts!

@robertknight
Copy link
Member

I did a write up in a Trello card a while back of the tasks that I could think of that were required to ship the Firefox extension: https://trello.com/c/VFLEZOaq/139-epic-firefox-extension

Note that this list was written around the time of Firefox 45, one of the items on that list (a workaround for chrome.tabs.executeScript) may no longer be applicable.

@danShumway
Copy link

The Trello card seems to have disappeared or become private, but it's clear from the commit history that Firefox is being worked on.

What's the current status? Anything that I or other people could help with?

@tilgovi
Copy link
Contributor

tilgovi commented Aug 27, 2017

Also willing to help.

@robertknight
Copy link
Member

Hello - The Firefox extension is working and we're building it and getting it signed on every Travis build. The remaining work to get this deployed is:

  • Generate an update manifest and upload it to a fixed location that the Web Extension's manifest can reference
  • Publish the release builds to a fixed location that we can reference on the website
  • Add suitable links and documentation

I'm guessing we'll publish the update manifest and packages on cdn.hypothes.is which is a CloudFront distribution in front of an Amazon S3 bucket.

We'll need to set up the keys for uploading to the actual S3 bucket, but if someone wanted to take a look at getting this working for upload to some S3 bucket (taking the bucket name and keys from environment variables), that could be helpful.

For Microsoft Edge, any help checking the current status of Chrome API support against the current version of our extension and figuring out how we can build a working Edge extension as part of the Travis builds, would be welcome.

@tilgovi
Copy link
Contributor

tilgovi commented Aug 31, 2017

I tried downloading the latest prod build from the travis output: https://s3.amazonaws.com/hypothesis-build/hypothesis/browser-extension/310/310.1/dist/20170821-firefox-prod.xpi

Firefox tells me it cannot be installed because it's corrupt :-/.

@robertknight
Copy link
Member

Thanks for flagging that up @tilgovi . It was working at some point not long ago, so it needs investigation.

@robertknight
Copy link
Member

The extension installs successfully when downloaded from addons.mozilla.org (nb. It is not listed publicly, only H staff can see it), so there must be an issue with what is being either downloaded from the AMO API or uploaded to S3.

@robertknight
Copy link
Member

Ah - I see. It looks like the Travis artefact upload only uploads the WebExtension archive before signing, which confusingly also has a ".xpi" extension. The signed build is only being uploaded to AMO. I'll need to get this build uploaded somewhere more permanent, likely on cdn.hypothes.is.

@almet
Copy link

almet commented Oct 9, 2017

I've managed to install it by:

  • downloading the addon .xpi (with a wget command, Firefox won't let you do it otherwise);
  • extracting its content locally;
  • in about:config, set xpinstall.signatures.required to false
  • in about:debugging, select install temp addon, and that should be it!

@tilgovi
Copy link
Contributor

tilgovi commented Oct 22, 2017

Just dumping context for anyone else who wants to look at this after poking at it for a few minutes yesterday.

Two issues:

  • The unsigned XPI is bundled inside the signed XPI
  • The signed XPI is, I think, uploaded, but it's "corrupted"

The second point may be wrong. It's possible that I'm misunderstanding the flow here and the signing does not happen. Without access to the AMO keys I can't try it locally to debug, but I can try doing it from my own account on a fork when I have more time.

@gustavklopp
Copy link

gustavklopp commented Jan 1, 2018

I can install it with the file downloaded at https://s3.amazonaws.com/hypothesis-build/hypothesis/browser-extension/310/310.1/dist/20170821-firefox-prod.xpi and following the steps given by @almet but then, I can't login into a Hypothes.is account: clicking on all the login button does nothing...

(the waiting icon on the right of the search icon is fixed, it's not due to the screenshot)

screenshot-2018-1-1 hypothesis

@ttuygun
Copy link

ttuygun commented Jan 27, 2018

I tried to convert webextension using Chrome Store Foxified add-on from latest version of extension in Chrome Web Store but there is some problems:
"/incognito" should be equal to one of the allowed values

I tried to change the incognito value to different one but I cannot figure out the signing. Can anybody try to download latest version of Chrome add-on and change the incognite value to acceptable parameter (Any parameter which don't require any effort for working. It's a issue related with incognito window of add-on. I think it doesn't matter at the moment using incognito or not) @gustavklopp @tilgovi @almet @danShumway @sean-roberts @robertknight @judell

@almet
Copy link

almet commented Jan 28, 2018

Hi, this issue is almost one year old, and there is still no Firefox support built-in into hypothesis. Is there any will to make this happen at the project level or is the status quo considered good enough by the team? Thanks!

@robertknight
Copy link
Member

Hello @almet - This is still on our roadmap under the banner of making Hypothesis as widely available as possible. However for various reasons we have been focused on other projects over the past year and that will continue to be the case for the next couple of months at least. The current status of the Web Extension has not changed since my last comment.

@almet
Copy link

almet commented Jan 29, 2018

Thank you for your message ! Hope to have this available at some point !

@wefahakem
Copy link

@ttuygun When you tested the extension generated from Chrome Store Foxified, did you have a problem $digest in running the extension?

@klemay
Copy link
Contributor

klemay commented Aug 27, 2018

Closing in favor of: hypothesis/product-backlog#637

@klemay klemay closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants