From 0d252b53ec6c28b574c7b101d2fe76424c3ea836 Mon Sep 17 00:00:00 2001 From: SimonBrazell Date: Fri, 15 May 2020 09:46:01 +1000 Subject: [PATCH] Closes #49 - added to options menu too & added privacy policy --- manifest.json | 2 +- pages/options/options.js | 26 ++++++++++++++++++++++---- privacy-policy.md | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 privacy-policy.md diff --git a/manifest.json b/manifest.json index 17d68a8..4b3b14b 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Privacy Redirect", "description": "Redirects Twitter, YouTube, Instagram & Google Maps requests to privacy friendly alternatives.", - "version": "1.1.26", + "version": "1.1.27", "manifest_version": 2, "background": { "scripts": [ diff --git a/pages/options/options.js b/pages/options/options.js index 8b848e6..5e25a49 100644 --- a/pages/options/options.js +++ b/pages/options/options.js @@ -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(() => { if (nitterInstance.checkValidity()) { browser.storage.sync.set({ - nitterInstance: nitterInstance.value ? new URL(nitterInstance.value).origin : '' + nitterInstance: parseURL(nitterInstance.value) }); } }, 500); @@ -148,7 +166,7 @@ nitterInstance.addEventListener('input', nitterInstanceChange); let invidiousInstanceChange = debounce(() => { if (invidiousInstance.checkValidity()) { browser.storage.sync.set({ - invidiousInstance: invidiousInstance.value ? new URL(invidiousInstance.value).origin : '' + invidiousInstance: parseURL(invidiousInstance.value) }); } }, 500); @@ -157,7 +175,7 @@ invidiousInstance.addEventListener('input', invidiousInstanceChange); let bibliogramInstanceChange = debounce(() => { if (bibliogramInstance.checkValidity()) { browser.storage.sync.set({ - bibliogramInstance: bibliogramInstance.value ? new URL(bibliogramInstance.value).origin : '' + bibliogramInstance: parseURL(bibliogramInstance.value) }); } }, 500); @@ -166,7 +184,7 @@ bibliogramInstance.addEventListener('input', bibliogramInstanceChange); let osmInstanceChange = debounce(() => { if (osmInstance.checkValidity()) { browser.storage.sync.set({ - osmInstance: osmInstance.value ? new URL(osmInstance.value).origin : '' + osmInstance: parseURL(osmInstance.value) }); } }, 500); diff --git a/privacy-policy.md b/privacy-policy.md new file mode 100644 index 0000000..f27d90b --- /dev/null +++ b/privacy-policy.md @@ -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 doesn’t 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.