Skip to content

Commit

Permalink
Add agreement decline button to comply with Mozilla policies
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Sep 9, 2024
1 parent 07d2da4 commit 581e9b3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
18 changes: 17 additions & 1 deletion extension/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,24 @@
"message": "This extension exchanges personal data (current website and manifest URLs, as well as other PWA details) with the native program when the user initiates the PWA installation. This is necessary in order to correctly obtain and parse the Web Application Manifest and install the PWA. Data are stored on the computer as long as that PWA is installed. No personal data leave the computer or are sent to third parties.",
"description": "The privacy policy notice on the setup page"
},
"setupPageLicenseLinks": {
"message": "You can also read this <a href=\"https://addons.mozilla.org/firefox/addon/pwas-for-firefox/eula/\" target=\"_blank\">licence agreement</a> and <a href=\"https://addons.mozilla.org/firefox/addon/pwas-for-firefox/privacy/\" target=\"_blank\">privacy policy</a> on the AMO page.",
"description": "The links to the licence agreement and privacy policy on AMO on the setup page"
},
"setupPageLicenseConsent": {
"message": "You cannot use the extension if you do not consent to the above terms. In this case, you can uninstall it with the button below.",
"description": "The required consent and uninstallation notice on the setup page"
},
"setupPageLicenseUninstallation": {
"message": "You cannot use the extension if you do not consent to the provided terms. The extension will be uninstalled. You can reinstall it later if you change your mind.",
"description": "The dialog displayed when the user declines the license agreement"
},
"setupPageLicenseDecline": {
"message": "Decline and Uninstall",
"description": "The decline and uninstall button on the setup page"
},
"setupPageLicenseAccept": {
"message": "I accept the license agreement",
"message": "Accept the Agreement",
"description": "The license accept button on the setup page"
},
"setupPageConnectorInstallationMain": {
Expand Down
6 changes: 5 additions & 1 deletion extension/src/setup/install.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@ <h1 class="text-center" data-i18n="setupPageTitle"></h1>
</ul>
<hr />
<p data-i18n="setupPageLicensePrivacyPolicy"></p>
<hr />
<p data-i18n="setupPageLicenseLinks"></p>
<p data-i18n="setupPageLicenseConsent"></p>
</blockquote>
<div class="text-center">
<button type="button" class="btn btn-outline-success" id="license-agreement-accept" data-i18n="setupPageLicenseAccept"></button>
<button type="button" class="btn btn-outline-danger me-2" id="license-agreement-decline" data-i18n="setupPageLicenseDecline"></button>
<button type="button" class="btn btn-outline-success ms-2" id="license-agreement-accept" data-i18n="setupPageLicenseAccept"></button>
</div>
</div>

Expand Down
4 changes: 4 additions & 0 deletions extension/src/setup/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ async function checkLicenseAgreement () {
}
}

document.getElementById('license-agreement-decline').onclick = async function () {
await browser.management.uninstallSelf({ showConfirmDialog: true, dialogMessage: await getMessage('setupPageLicenseUninstallation') + '\n' })
}

document.getElementById('license-agreement-accept').onclick = async function () {
await browser.storage.local.set({ [STORAGE_LICENSE_ACCEPTED]: true })
await checkLicenseAgreement()
Expand Down

0 comments on commit 581e9b3

Please sign in to comment.