diff --git a/src/html/consent.html b/src/html/consent.html index 35c5128a..594f62a1 100644 --- a/src/html/consent.html +++ b/src/html/consent.html @@ -37,7 +37,6 @@ border-radius: 8px; /* Increase border radius for a softer look */ transition: background-color 0.3s ease; } - @@ -53,10 +52,10 @@

Thank you for installing FastForward

This extension collects the tab url when you choose to add a website to the whitelist, and temporarily processes the url of bypassed sites while navigating them. This data never leaves your device.

- Additionally, if the "Crowd Bypass" option is enabled, the extension may send some bypassed urls to our server to be processed and added to our database in accordance with our privacy policy. They are never shared. + Additionally, if the "Crowd Bypass" option is enabled, the extension may send some bypassed urls to our server to be processed and added to our database in accordance with our privacy policy. They are never shared.

- If you consent to this data collection hit "Agree" to continue. Otherwise hit "Refuse" and the extension will be uninstalled. + If you consent to this data collection hit "Agree" to continue and then allow the permission request. Otherwise hit "Refuse" and the extension will be uninstalled.

diff --git a/src/html/consent.js b/src/html/consent.js index 35bb6f35..d6b6d2f5 100644 --- a/src/html/consent.js +++ b/src/html/consent.js @@ -15,8 +15,23 @@ async function getConsentStatus() { // Event listener for "Agree" button document.querySelector('#agree').addEventListener('click', async function () { console.log("Agree button clicked."); + const permissionsToRequest = { + origins: [""], + }; + function onResponse(response) { + if (response) { + console.log("Permission was granted"); + window.close(); // Close the window after permission is granted + } else { + console.log("Permission was refused"); + browser.management.uninstallSelf(); + } + return browser.permissions.getAll(); + } + const response = await browser.permissions.request(permissionsToRequest); + const currentPermissions = await onResponse(response); + console.log(`Current permissions:`, currentPermissions); await saveConsentStatus('consent-granted'); - window.close(); }); // Event listener for "Refuse" button