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

Switch from Chrome-specific API to browser-agnostic API #9

Open
wants to merge 8 commits into
base: webpack
Choose a base branch
from

Conversation

rossjrw
Copy link
Member

@rossjrw rossjrw commented Dec 30, 2020

This PR switches from the chrome api to the browser API, with the webextensions-polyfill library acting as a polyfill for Chrome (which doesn't implement the WebExtensions API directly). This will enable the extension to work on all browsers except for Safari.

This PR also cleans up the JS a little bit.

This PR requires #8 but merges into master, so after #8 is merged, the base branch should be changed to master.

  • Use browser-agnostic API
  • Export a ZIP bundle (which is needed for testing on Firefox)
  • Get it working

Later, we'll need to work out signing for Firefox addons, as unsigned extensions are blocked from being added to the browser (they can only be added to Developer Edition and even then only after toggling a config flag). There are a lot of hoops to jump through. In the meantime, the extension can be tested on Firefox Developer Edition by setting xpinstall.signatures.required to false in about:config.

@rossjrw rossjrw marked this pull request as draft December 30, 2020 17:13
@rossjrw
Copy link
Member Author

rossjrw commented Dec 30, 2020

Noting that at this point the extension loads fine in both Firefox and Edge without errors (although Edge complains about browser_specific_settings not being a valid key, which it is wrong about), and the options page works as expected, but no changes are visible on the wiki and there are no errors in the console. Did I get something wrong re: requesting permissions? It worked in Edge as of #8...

Update: I forgot to re-add document.append

@rossjrw rossjrw changed the base branch from master to webpack December 30, 2020 19:27
@rossjrw rossjrw marked this pull request as ready for review December 30, 2020 23:38
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

Successfully merging this pull request may close these issues.

1 participant