about summary refs log tree commit diff stats
path: root/background.js
diff options
context:
space:
mode:
authorSimonBrazell <simon@brazell.com.au>2020-04-26 10:00:06 +1000
committerSimonBrazell <simon@brazell.com.au>2020-04-26 10:00:06 +1000
commit40ce0ed20be64bc0878ba58f6451ef131951ba02 (patch)
tree76284b5ff41dba50347d2b3ce3caf8b4cf808f71 /background.js
parentCloses #27 - added ability to whitelist sites (diff)
downloadlibredirect-40ce0ed20be64bc0878ba58f6451ef131951ba02.zip
Fixes #40 - Empty whitelist broke redirects
Diffstat (limited to 'background.js')
-rw-r--r--background.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/background.js b/background.js
index 96c6a146..f249b80f 100644
--- a/background.js
+++ b/background.js
@@ -92,8 +92,7 @@ browser.storage.sync.get(
     alwaysProxy = result.alwaysProxy;
     onlyEmbeddedVideo = result.onlyEmbeddedVideo;
     videoQuality = result.videoQuality;
-    whitelist = result.whitelist.map(e => new RegExp(e));
-    console.log(whitelist);
+    whitelist = result.whitelist ? result.whitelist.map(e => new RegExp(e)) : [];
   }
 );
 
@@ -133,7 +132,6 @@ browser.storage.onChanged.addListener(changes => {
   }
   if ('whitelist' in changes) {
     whitelist = changes.whitelist.newValue.map(e => new RegExp(e));
-    console.log(whitelist);
   }
 });