1

I want to develop a Chrome extension that can access an IndexedDB that was created by an origin that is different from the one where the Chrome extension is active.

From the docs it seems that IndexedDB defines a single origin access policy which makes me think that it would not be possible.

The consensus on this question seems to be that it is not possible.

Could someone please provide some guidance on whether it is possible or not? And if not, are there any workarounds?

One possible workaround, outlined here, is for the domain and the extension to share an iFrame and use the frame to create an IndexedDB which stores the shared data, but this feels hacky.

  • 1
    Extensions don't have any special API for DOM storage so they can only access such a storage for a different domain (origin) using a content script (it was mentioned in the question you've linked). Naturally, content scripts need a page to run in so you'll have to use an iframe or a tab with that site open. This is how it is, there's no other way. – wOxxOm Apr 27 '20 at 04:21

0 Answers0