about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSimonBrazell <simon@brazell.com.au>2020-05-15 09:46:01 +1000
committerSimonBrazell <simon@brazell.com.au>2020-05-15 09:46:01 +1000
commit0d252b53ec6c28b574c7b101d2fe76424c3ea836 (patch)
tree0568a5780473b2ce83ff2ffaeaf1e33b99f7abef
parentCloses #49 - Allow basic authentication credentials in instances (diff)
downloadlibredirect-0d252b53ec6c28b574c7b101d2fe76424c3ea836.zip
Closes #49 - added to options menu too & added privacy policy
-rw-r--r--manifest.json2
-rw-r--r--pages/options/options.js26
-rw-r--r--privacy-policy.md19
3 files changed, 42 insertions, 5 deletions
diff --git a/manifest.json b/manifest.json
index 17d68a88..4b3b14bb 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 8b848e64..5e25a495 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 00000000..f27d90bd
--- /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.