简体   繁体   中英

Chrome devtools extension for IndexedDB

I am trying to build a tool that facilitates CRUD operations ie, 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM