Access to indexedb


#1

hey @leedohm! do you happen to know how to access indexdb from atom inside chromium… im getting Uncaught SecurityError: Failed to execute ‘open’ on ‘IDBFactory’: access to the Indexed Database API is denied in this context. can you help me?? thanks! :metal:


#2

Sorry, I haven’t played around with atom-shell that much. @zcbenz, do you have any tips?


#3

@leedohm thanks! @zcbenz is there any workaround accessing indexdb from inside an iframe… that seems to be the problem…


#4

@joaoafrmartins How are you accessing IndexedDB? Is there some code sample visible somewhere?


#5

@abe not really im using mozilla/localforage on a pet project… the problem is that indexedb is disallowed inside iframes… and im using an iframe to embed a html page inside atom using atom-development-server package…


#6

I am also have trouble accessing the indexdb.
In my case is i want to accessing indexdb from external site.

detail approach

I am using BrowserWindow to access the external site.

    console.log "db name: #{@db.name}";
    console.log "db version: #{@db.version}";
    console.log "stored #{@db.objectStoreNames.length}";

I assure that the indexdb already there, by manually interact with the new window UI. But it code above only give me db name, version with objectStoreNames.length 0.

Manual inspection via atom developer tools give: Security origin: file:…, Name: dbname, Version: some number

Also i can’t inspect from the new window, Presumably it disabled by default.
My suspicion is the new window have it’s on scope and context, but i am trying to retrieve on atom scope and context.

Let me know if i am wrong, or kindly give quick pointer. :smile: