Skip to content

Commit

Permalink
fix: STORAGE_CACHE possibly undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwidua committed Oct 20, 2021
1 parent ef56a03 commit a895799
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ chrome.runtime.onInstalled.addListener((details) => {
*/
chrome.storage.onChanged.addListener((changes) => {
for (let [key, { newValue }] of Object.entries(changes)) {
if (!STORAGE_CACHE) return
STORAGE_CACHE[key] = newValue
}
})
Expand All @@ -47,6 +48,7 @@ function handleNavigation(data) {

const url = new URL(data.url)

// Prevent extension triggering on embedded content
if (data.transitionType === 'auto_subframe') return

function handleInjection(_data) {
Expand Down

0 comments on commit a895799

Please sign in to comment.