How to access extension's local storage from a blocking onBeforeSendHeaders webRequest hook?

10 Views Asked by At

My extension is an MV2 chrome extension.
I need to access a value stored in the extension's local storage from within a blocking webRequest hook (MV2 chrome.webRequest.onBeforeSendHeaders).

Since it is blocking, the listener must not be async. How can I access the extension's local storage inside the hook?

I tried to use the window object to sync it with the local storage and then access it inside the listener, but it is too flaky and bad practice.

0

There are 0 best solutions below