Skip to content

Commit

Permalink
try to wake up background worker after chrome restarts
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Sep 19, 2024
1 parent 98674dd commit e86b65f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions extension/src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,15 @@ const toggle = async (tab: chrome.tabs.Tab) => {
})
}
}

chrome.action.onClicked.addListener(toggle)

// wake up the background script after chrome restarts
// this fixes an issue of the action onClicked listener not being triggered (see: https://stackoverflow.com/a/76344225)
chrome.runtime.onStartup.addListener(() => {
console.debug(`Zodiac Pilot startup`)
})

// Track extension tabs that are actively simulating, meaning that RPC requests are being sent to
// a fork network.
const simulatingExtensionTabs = new Map<number, Fork>()
Expand Down

0 comments on commit e86b65f

Please sign in to comment.