I’m making an extension to automate a dozen API calls to a website I frequently use (Brightspace) so that I can quickly summary a lot of information very quickly. For security reasons and given how hacky it is so far, this extension WILL NOT be shared with others.
In the host page. I can easily access my JWT and from there I can craft all the necessary requests with fetch, parse, and organize the information how I want. (JSON.parse(localStorage["D2L.Fetch.Tokens"])["*:*:*"].access_token)
The problem is I’m now trying to move this code to a Firefox popup extension and I cannot find any way to access the host page localStorage directly. The only way I found is to make a content_scripts script that reads my JWT then saves it in browser.storage.sync so that my popup extension can then read it from there.
Is there a clean and direct way for popup extensions to read the host page localStorage?