pouchdb / pouchdb-fauxton-chrome-extension

Unmaintained: see #17
26 stars 6 forks source link

Doesn't work with Web SQL #1

Closed nolanlawson closed 9 years ago

nolanlawson commented 9 years ago

E.g. at http://npm-browser.com, where we prefer WebSQL to IndexedDB, nothing shows up. It works in the Firefox add-on, though.

marten-de-vries commented 9 years ago

I've thought about implementing this, but I can't find a way to get a list of websql databases:

  1. The websql spec explicitly states that it's impossible. ('There is no way to enumerate or delete the databases available for an origin from this API.')
  2. There's no Chrome extension API for that either.
  3. Chrome also doesn't have API's which would allow me to access the profile directory so I could read the info directly from the underlying sqlite files, like I do for indexeddb in Firefox.

Other ideas welcome, because without one, this can't move forward.

nolanlawson commented 9 years ago

Yeah, I even looked at the Chrome Dev Tools source code and couldn't figure out how they enumerate the WebSQL databases.

Not a big deal, since most people will be debugging in either Chrome or Firefox anyway.

marten-de-vries commented 9 years ago

It might be possible to wrap the window.openDatabase() function in the extension on loading every page (also when the panel itself isn't active), that way as long as the extension was installed when the DB was opened at least once, it would be there. Performance + the need to check if a database hasn't been destroyed in the meantime are pretty major disadvantages though...

nolanlawson commented 9 years ago

See responses here: https://twitter.com/nolanlawson/status/528954085131960320

So it might be possible!

nolanlawson commented 9 years ago

Ah okay, apparently only in Dev Tools extensions.

marten-de-vries commented 9 years ago

Another option: Making the user install a small executable that handles reading the sqlite files from disk, and passes the info on using stdout. Then use the native messaging API.

tlvince commented 9 years ago

I ran into this. As an intermediary step, could you notify the user? Something as simple as 'WebSQL databases are currently unsupported by pouchdb-inspector' would help save some time :)

marten-de-vries commented 9 years ago

@tlvince It's already in the first paragraph of the README.md file. I've now also added a notification to the Chrome web store page.

Since there seems to be no solution that's really workable, I'm going to close this. If someone wants to work on something using one of the above hacks I would consider merging it, but I don't think it's worth the effort myself.