Closed kangzoel closed 4 years ago
That code is overly complicated unfortunately. Unfortunately, you can't just get a reference to storageArea object from one extension into another, since they run in different processes. So instead I use devtools.inspectedWindow.eval
to inject this script: https://github.com/jusio/storage-area-explorer/blob/master/app/injects/extension-page-inject.js into the target extension. This code runs inside inspected extension context, so the only way it can communicate with my extension, is by using chrome ports API. E.g. I just open a port from inspected extension into my own extension, and in order to get or send anything from inspected extension, I just send message to it via port, and sends responses back via same port. Hope this helps.
Thank you so much for the explanation 😁
Can you tell me how did you get the chrome.storage of another extension? I am not an angular developer, so I can barely understand the code. I've tried this code on my own devtools extension:
but it returns only the empty objects of set and get. Not the function itself. What should I learn to inspect the target extension's storage? I am sorry for asking this question here. I can't find any other resource besides your code.