Closes #49 - added to options menu too & added privacy policy

This commit is contained in:
SimonBrazell 2020-05-15 09:46:01 +10:00
parent 83296f8972
commit 0d252b53ec
3 changed files with 42 additions and 5 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "Privacy Redirect", "name": "Privacy Redirect",
"description": "Redirects Twitter, YouTube, Instagram & Google Maps requests to privacy friendly alternatives.", "description": "Redirects Twitter, YouTube, Instagram & Google Maps requests to privacy friendly alternatives.",
"version": "1.1.26", "version": "1.1.27",
"manifest_version": 2, "manifest_version": 2,
"background": { "background": {
"scripts": [ "scripts": [

View File

@ -136,10 +136,28 @@ function debounce(func, wait, immediate) {
}; };
}; };
function parseURL(urlString) {
if (urlString) {
try {
const url = new URL(urlString);
if (url.username && url.password) {
return `${url.protocol}//${url.username}:${url.password}@${url.host}`
} else {
return url.origin;
}
} catch (error) {
console.log(error);
return '';
}
} else {
return '';
}
}
let nitterInstanceChange = debounce(() => { let nitterInstanceChange = debounce(() => {
if (nitterInstance.checkValidity()) { if (nitterInstance.checkValidity()) {
browser.storage.sync.set({ browser.storage.sync.set({
nitterInstance: nitterInstance.value ? new URL(nitterInstance.value).origin : '' nitterInstance: parseURL(nitterInstance.value)
}); });
} }
}, 500); }, 500);
@ -148,7 +166,7 @@ nitterInstance.addEventListener('input', nitterInstanceChange);
let invidiousInstanceChange = debounce(() => { let invidiousInstanceChange = debounce(() => {
if (invidiousInstance.checkValidity()) { if (invidiousInstance.checkValidity()) {
browser.storage.sync.set({ browser.storage.sync.set({
invidiousInstance: invidiousInstance.value ? new URL(invidiousInstance.value).origin : '' invidiousInstance: parseURL(invidiousInstance.value)
}); });
} }
}, 500); }, 500);
@ -157,7 +175,7 @@ invidiousInstance.addEventListener('input', invidiousInstanceChange);
let bibliogramInstanceChange = debounce(() => { let bibliogramInstanceChange = debounce(() => {
if (bibliogramInstance.checkValidity()) { if (bibliogramInstance.checkValidity()) {
browser.storage.sync.set({ browser.storage.sync.set({
bibliogramInstance: bibliogramInstance.value ? new URL(bibliogramInstance.value).origin : '' bibliogramInstance: parseURL(bibliogramInstance.value)
}); });
} }
}, 500); }, 500);
@ -166,7 +184,7 @@ bibliogramInstance.addEventListener('input', bibliogramInstanceChange);
let osmInstanceChange = debounce(() => { let osmInstanceChange = debounce(() => {
if (osmInstance.checkValidity()) { if (osmInstance.checkValidity()) {
browser.storage.sync.set({ browser.storage.sync.set({
osmInstance: osmInstance.value ? new URL(osmInstance.value).origin : '' osmInstance: parseURL(osmInstance.value)
}); });
} }
}, 500); }, 500);

19
privacy-policy.md Normal file
View File

@ -0,0 +1,19 @@
# Privacy Policy for Privacy Redirect
**I solemnly swear this extension is up to only good! 🙂**
All aspects of the extension work locally on your device. With the exception of
OpenStreetMap (OSM) reverse geocoding, done via the [OSM Nomantim API](https://nominatim.org/release-docs/latest/),
used as part of OSM redirects, the extension does not connect to any other
third-party web services and it doesnt collect or transmit
any infromation about you, your browsing habits, or your device.
The extension requires access to you data for **all websites** in order
to intercept requests made to targeted services (Twitter, YouTube, Instagram &
Google Maps) so that they may be redirected to the appropriate privacy
respecting alternative, all other requests are ignored.
The extension also requires **local storage** permissions in order to store
extension specific user preferences and settings.
The extension development is funded through gifts, donations and love.