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

Firefox support #37

Open
jeroenev opened this issue Jan 11, 2019 · 5 comments
Open

Firefox support #37

jeroenev opened this issue Jan 11, 2019 · 5 comments

Comments

@jeroenev
Copy link
Contributor

how much work would it be to add support for firefox? would it be hard to do?

@Manvel
Copy link
Member

Manvel commented Jan 11, 2019

I don't think so, that's something that I have planned, but never got my hands into it, the only big issue I can see is that a better UI/UX needs to be developed as current one not much scalable, AFAIK some privacy settings(in Privacy management section) are different in Firefox and some other browsers not available at all ex. Edge, but other than that should be relatively trivial as far as I can see, plus a polyfill needs to be created, for web extensions API, in Firefox the API is using Promises and global browser instead of chrome is used, for Edge I'd wait until they switch the engine, because lately I was having some issues with API incompatibilities and AFAIK Privacy API is not yet implemented.

Firefox migration requires:

  • Polyfill for the Web Extensions API
    • Switch to using Promises instead of callbacks
  • Study of Privacy API differences and documentation for each of them
    • Might require UI/UX redesign
      • Make layout more flexible for settings amount.
      • Some Privacy settings are not Boolean.

Some notes out of scope

The route I will be happy/wish to take, prioritize, because I hate current codebase and fragility of it:

  • Modularize PM (Can be tackled partially, for the most fragile components)
    • Thinking around current lines
      • Web Components ?
      • Browserify ?
  • Implement tests (Shipping new features to multiple browsers, can be really painful without them)
    • For components
    • Integration tests
  • Switch into using Promises and refactor code using ES6 features

More browsers usually mean more issues (currently I'm getting a lot of complains about Vivaldi and Opera) and current codebase is quite fragile(as you might notice during PR review), I think we could have shipped the new feature in 1-2weeks if I had all the tests and guidance in place.

I wish to make further development as painless as possible and more joy-full,

Will this take forever ?

No it will not, I'll get more time for my projects starting this year April and I really hope you will still keep pushing me and Privacy manager. that way I'll be able to prioritize PM from other projects I'm working on :)

What if we start right away and skip some of steps?

We need to tackle current things:

  • Start using Promises for Browser APIs
  • Add more Privacy Settings and write descriptions that are different between Chrome and Firefox
  • Implement automated extension tests in different browsers

@Manvel
Copy link
Member

Manvel commented Jan 3, 2020

browser.permissions.onRemoved and browser.permissions.onAdded are not supported in Firefox, but there is a polyfill worth looking at https://github.com/fregante/webext-permissions-events-polyfill

@Manvel
Copy link
Member

Manvel commented Jan 5, 2020

BrowserSetting.onChange is only implemented in Firefox 72+, see -> https://bugzilla.mozilla.org/show_bug.cgi?id=1410412

@Manvel
Copy link
Member

Manvel commented Jan 5, 2020

requesting/removing optional permission, throws current error in Firefox:

Error: permissions.request may only be called from a user input handler

This seem to be caused by prio permission state check, which seems to be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1398833

@Manvel
Copy link
Member

Manvel commented Jan 6, 2020

Another bug which currently is blocking Firefox support.

Firefox doesn't allow requesting optional permissions from the popup window -> https://bugzilla.mozilla.org/show_bug.cgi?id=1432083

Also requesting it from the Background page, doesn't seem to work, as it throws again:

permissions.request may only be called from a user input handler

Which is seem to be related to the previous comment.

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

2 participants