Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible for a Chrome extension to access an IndexedDB database created by a specific domain?

If http://example.com/ creates an IndexedDB database, is it possible for a Chrome extension (used on domains other than example.com) to open and query this database?

like image 436
Alf Eaton Avatar asked Nov 19 '12 12:11

Alf Eaton


People also ask

Can two different websites access the same IndexedDB in Chrome?

According to MDN you can't do cross domain access to an indexedDB (for security reason, you don't want that another website modify your client database): IndexedDB follows a same-origin policy. So while you can access stored data within a domain, you cannot access data across different domains.

What data can Chrome extensions access?

Your tabs and browsing activity: The app or extension can see the URLs and titles of websites you visit. It can also open and close tabs and windows, as well as navigate to new pages in open tabs and windows. Your physical location: The app or extension can use the current location of your computer or device.


2 Answers

Yes, IndexedDB can be accessed through chrome extension with the help of content scripts. Content Scripts can access the indexedDB storage of the domain you have specified in manifest.json file.

For more info check here: https://stackoverflow.com/a/60002682/9131807

like image 189
neelesh bisht Avatar answered Oct 08 '22 01:10

neelesh bisht


No, you can not do it. The data storage is sandboxed http://www.html5rocks.com/en/tutorials/offline/storage/

like image 40
Sudarshan Avatar answered Oct 07 '22 23:10

Sudarshan