Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome devtools extension for IndexedDB

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.

like image 905
Raghavendra Avatar asked Nov 09 '22 16:11

Raghavendra


1 Answers

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

like image 94
jengeb Avatar answered Nov 14 '22 22:11

jengeb