From content.js I need to detect the extension state (enabled/disabled). Currently I'm using chrome.storage.sync.set
in background.js to set the state, and chrome.storage.sync.get
in content.js to get the state. However this is running asynchronously, which is not what I want. Is there a way to get the extension state synchronously (i.e. the page loading will freeze until I get the current state)?
Asked
Active
Viewed 51 times
1

Fulalas
- 127
- 8
-
No. The only workaround in Chrome is [webRequest + cookies](https://stackoverflow.com/a/45105934/). – wOxxOm May 23 '19 at 07:51