I am trying to build a tool that facilitates CRUD operations i.e., a GUI for IndexedDB in Chrome. When I opened the database connection in the chrome dev tools panel, I found out that it has a separate IndexedDB store for panel.html for itself. Panel cannot access the current page's database.
Is there any way we can access page's database from a chrome dev tool's extension panel.
The current page's IndexedDB can't be accessed from within the extension (or the extension's dev tools) due to security reasons:
"IndexedDB uses the same-origin principle, which means that it ties the store to the origin of the site that creates it (typically, this is the site domain or subdomain)." https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Security
But as pointed out by aug it is possible to request cross-origin permissions:
"By adding hosts or host match patterns (or both) to the permissions section of the manifest file, the extension can request access to remote servers outside of its origin." https://developer.chrome.com/extensions/xhr#requesting-permission
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With