forked from Saghen/aw-watcher-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: privacy notice consent popup for Firefox (ActivityWatch#99)
* 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]>
- Loading branch information
1 parent
b47fa73
commit 5379254
Showing
9 changed files
with
170 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
|
||
"background": { | ||
"scripts": [ | ||
"static/installed.js", | ||
"out/app.js" | ||
], | ||
"persistent": false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>ActivityWatch Consent Dialog</title> | ||
|
||
<link href="./style.css" rel="stylesheet" type="text/css"> | ||
|
||
<script src="./consent.js"></script> | ||
</head> | ||
|
||
<body class="consent"> | ||
<img src="/media/banners/banner.png" style="width: 100%"> | ||
|
||
<hr> | ||
|
||
<h1>Privacy Notice</h1> | ||
<p> | ||
This extension by nature collects personal identifiable information in the form of URLs. All collected information never leaves your device because all data is only forwarded to localhost. Since this is the core functionality of this extension, the only option to not consent, is to uninstall. | ||
</p> | ||
<div class="action-container"> | ||
<div class="action"><button class="button" id="consent-refused">Remove ActivityWatch</button></div> | ||
<div class="action"><button class="button accept" id="consent-given">Consent to offline data collection</button></div> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"use strict"; | ||
|
||
function consentListeners() { | ||
let consent_refused = document.getElementById('consent-refused'); | ||
let consent_given = document.getElementById('consent-given'); | ||
consent_refused.addEventListener("click", (obj) => { | ||
browser.management.uninstallSelf() | ||
window.close() | ||
}); | ||
consent_given.addEventListener("click", (obj) => { | ||
chrome.runtime.sendMessage({enabled: true}, function(response) {}); | ||
chrome.storage.local.set({"noConsentGiven": false}); | ||
window.close() | ||
}) | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', function() { | ||
consentListeners(); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
|
||
chrome.runtime.onInstalled.addListener(async ({ reason, temporary }) => { | ||
switch (reason) { | ||
case "install": | ||
{ | ||
chrome.storage.local.set({"askConsent": true}); | ||
} | ||
break; | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters