Browse Source

Remove all origins that are not in the sync store

simov 9 years ago
parent
commit
2713e1ed16
1 changed files with 8 additions and 0 deletions
  1. 8 0
      background/background.js

+ 8 - 0
background/background.js

@@ -19,6 +19,14 @@ chrome.storage.sync.get((res) => {
       origins: {}
     })
   }
+  // reload extension bug
+  chrome.permissions.getAll((permissions) => {
+    var origins = Object.keys(res.origins)
+    chrome.permissions.remove({
+      origins: permissions.origins
+        .filter((origin) => (origins.indexOf(origin.slice(0, -2)) === -1))
+    })
+  })
 })
 
 function parallel (tasks, done) {