Skip to content

Commit

Permalink
Revert "remove consent temporarily to confirm"
Browse files Browse the repository at this point in the history
This reverts commit 27db7ce.
  • Loading branch information
driedpampas committed Sep 30, 2023
1 parent 27db7ce commit 9bd6e41
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/html/consent.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<title>FastForward</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="base.js"></script>
<link rel="stylesheet" href="style.css" />
<style>
.container {
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
padding: 20px;
width: 80%;
max-width: 600px;
margin: 0 auto;
text-align: center;
}
p {
color: #ffffff;
font-size: 28px;
line-height: 1.5;
}
.buttons {
border: none; /* Increase border width for better visibility */
border-image: linear-gradient(
135deg,
var(--ff-aqua) 0%,
var(--ff-blue) 50%,
var(--ff-purple) 100%
) 1;
background-color: transparent;
border: none;
padding: 18px 36px; /* Increase padding for a larger button */
font-size: 24px; /* Use a font size of 24px for better readability */
cursor: pointer;
border-radius: 8px; /* Increase border radius for a softer look */
transition: background-color 0.3s ease;
}

</style>
</head>
<body>
<nav>
<ul>
<div class="logo-wrapper"><img class="logo" src="../icon/branding.png" alt="FastForward"></div>
</ul>
</nav>
<div class="uk-margin-top uk-margin-bottom uk-margin-left uk-margin-right">
<div class="container">
<h2>Thank you for installing FastForward</h2>
<p>
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.
</p>
<P>
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 <a href="https://FastForward.team/privacy" target="_blank">privacy policy</a>. They are never shared.
</P>
<p>
If you consent to this data collection hit "Agree" to continue. Otherwise hit "Refuse" and the extension will be uninstalled.
</p>
<button id="agree" class="buttons">Agree</button>
<button id="refuse" class="buttons">Refuse</button>
</div>
<script src="consent.js"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions src/html/consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Function to save consent status
async function saveConsentStatus(consentStatus) {
return browser.storage.local.set({ consentStatus: consentStatus });
}

// Function to get consent status
async function getConsentStatus() {
return new Promise((resolve) => {
browser.storage.local.get('consentStatus').then((result) => {
resolve(result.consentStatus);
});
});
}

// Event listener for "Agree" button
document.querySelector('#agree').addEventListener('click', async function () {
console.log("Agree button clicked.");
await saveConsentStatus('consent-granted');
window.location.href = 'options.html';
});

// Event listener for "Refuse" button
document.querySelector('#refuse').addEventListener('click', async function () {
console.log("Uninstalling extension.");
browser.management.uninstallSelf();
});
20 changes: 20 additions & 0 deletions src/js/background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
import * as constants from './constants.js';

const isFirefox = /Firefox/i.test(navigator.userAgent);

// Check if the browser is Firefox
if (isFirefox) {
browser.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
browser.storage.local.get('consentStatus').then(function (data) {
const consentStatus = data.consentStatus;
if (consentStatus !== 'granted') {
browser.tabs.create({
url: 'html/consent.html',
});
return;
}
});
return;
}
});
}

const brws = typeof browser !== 'undefined' ? browser : chrome;
const fetchDomains = ['crowd.fastforward.team', 'redirect-api.work.ink']; //only allow requests to these domains

Expand Down

0 comments on commit 9bd6e41

Please sign in to comment.