Privacy-Manager icon indicating copy to clipboard operation
Privacy-Manager copied to clipboard

Firefox support

Open jeroenev opened this issue 6 years ago • 5 comments

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

jeroenev avatar Jan 11 '19 13:01 jeroenev

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 avatar Jan 11 '19 17:01 Manvel

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 avatar Jan 03 '20 15:01 Manvel

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

Manvel avatar Jan 05 '20 13:01 Manvel

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 avatar Jan 05 '20 15:01 Manvel

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.

Manvel avatar Jan 06 '20 10:01 Manvel