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

Feature: Privacy Notice Consent popup for Firefox #99

Merged

Conversation

Morpheus0x
Copy link
Contributor

This pull request addresses the issue raised here. This should satisfy the Mozilla addon review team. I have written a small Privacy Notice in static/consent.html, no idea if this is enough and if it can be used as a privacy policy for the whole addon...

I have added a saveguard to the normal addon popup page. If the user dismisses the privacy notice, the enable checkbox is disabled and a button is shown that shows the consent popup again.

I tested this with latest Firefox and Chromium.

static/popup.js Fixed Show fixed Hide fixed
@Morpheus0x
Copy link
Contributor Author

Something I forgot to mention, the consent popup explicitly only shows up for Firefox and not for any other fork or Chromium based Browser. The extension will just work as it has previously, except for Firefox.

let consent_refused = document.getElementById('consent-refused');
let consent_given = document.getElementById('consent-given');
consent_refused.addEventListener("click", (obj) => {
window.close()
Copy link
Member

@ErikBjare ErikBjare Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should prompt the user to uninstall/disable the extension, if we can, as per Mozilla guidelines: https://extensionworkshop.com/documentation/develop/best-practices-for-collecting-user-data-consents/

image

static/popup.js Outdated Show resolved Hide resolved
@ErikBjare
Copy link
Member

Very nice! Thank you for this @Morpheus0x ❤️

Can we prompt the user to uninstall the extension if they do not consent?

@Morpheus0x
Copy link
Contributor Author

Morpheus0x commented Jan 11, 2023

Very nice! Thank you for this @Morpheus0x heart

Can we prompt the user to uninstall the extension if they do not consent?

Happy to help 😃

I don't think that's possible. After quite a bit of googling, I didn't find anything, even though it is referenced twice on the page you linked (also at the very bottom image).
The only thing related I found was this stackoverflow question, but the AddonManager API seems deprecated, since no documentation exists. I didn't even try to use this.

That is why I implemented an additional safeguard if the user closes the popup and then tries to enable the watcher.

Edit: I will ask on the Mozilla Discourse what should be done according to these docs
Edit 2: here

@Morpheus0x
Copy link
Contributor Author

Got a very quick response from discourse and implemented remove extension. My safeguard is still valid, since the popup could just be closed, which doesn't remove the extension.

@Morpheus0x
Copy link
Contributor Author

Morpheus0x commented Jan 11, 2023

This should be my last commit for this feature. I forgot to add support to skip the consent window by setting the enterprise policy, see Adding policy support to your extension for info. I have added the needed enterprise policy to the readme.

Edit: I tested this again with latest Firefox and Chromium

@Morpheus0x
Copy link
Contributor Author

Any timeline for merging this PR? I would like to start working on #82 and don't want to get into any merge conflicts

@ErikBjare
Copy link
Member

I'm on vacation, but can merge it straight away in the meantime so you can keep working :)

@ErikBjare ErikBjare merged commit a93eb73 into ActivityWatch:master Jan 18, 2023
@ErikBjare
Copy link
Member

Thanks again for working on this @Morpheus0x ❤️

@Morpheus0x
Copy link
Contributor Author

I'm on vacation, but can merge it straight away in the meantime so you can keep working :)

Awesome, thanks, have a relaxing time.

Thanks again for working on this @Morpheus0x heart

Sure, no problem 😉

@GeorchW
Copy link

GeorchW commented Jan 27, 2023

Is the extension going to re-appear in the extension store soon then? Can I do anything to help with this?

powellnorma pushed a commit to powellnorma/aw-watcher-web that referenced this pull request Oct 3, 2024
* created consent page with style and js

* implemented ask consent popup

* renamed refuse button, since an extension can't uninstall itself

* implemented extra consent button, if first popup was denied

* extra script for installed listener needed to execute in time

* implemented button actions

* various bug fixes and made compatible with chrome

* cleanup

* added explicit semicolon

Co-authored-by: Erik Bjäreholt <[email protected]>

* implemented remove extension on consent refused

* implemented giving consent using enterprise policy

* added firefox enterprise policy example

* fixed typo

Co-authored-by: Erik Bjäreholt <[email protected]>
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.

3 participants