Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 401 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to access Google Chrome's IndexedDB/LevelDB files?

#1
I want to use Google Chrome's IndexedDB to persist data on the client-side.

Idea is to access the IndexedDB outside of chrome, via Node.JS, later on.
The background is the idea to track usage behaviour locally and store the collected data on the client for later analysis without a server backend.

From my understanding, the indexedDB is implemented as a LevelDB. However, I cannot open the levelDB with any of the tools/libs like [LevelUp][1]/[LevelDown][2] or [leveldb-json](

[To see links please register here]

).

I'm always getting this error message:

leveldb-dump-to-json --file test.json --db https_www.reddit.com_0.indexeddb.leveldb

events.js:141
throw er; // Unhandled 'error' event
^ OpenError: Invalid argument: idb_cmp1 does not match existing comparator : leveldb.BytewiseComparator
at /usr/local/lib/node_modules/leveldb- json/node_modules/levelup/lib/levelup.js:114:34 Christians-Air:IndexedDB

Can anybody please help? It seems as if the Chrome implementation is somehow special/different.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

Reply

#2
Keys in leveldb are arbitrary binary sequences. Clients implement [comparators][1] to define ordering between keys. The [default comparator][2] for leveldb is something equivalent to `strncmp`. Chrome's comparator for Indexed DB's store is more complicated. If you try and use a leveldb instance with a different comparator than it was created with you'll observe keys in seemingly random order, insertion would be unpredictable or cause corruption - dogs and cats living together, mass hysteria. So leveldb lets you name the comparator (persisted to the database) to help detect and avoid this mistake, which is what you're seeing. [Chrome's code names its comparator for Indexed DB][3] "idb_cmp1".

To inspect one of Chrome's Indexed DB leveldb instances outside of chrome you'd need to implement a compatible comparator. The code lives in Chrome's implementation at content/browser/indexed_db/indexed_db_backing_store.cc - and note that there's no guarantee that this is fixed across versions. (Apart from backwards compatibility, of course)

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#3
It's implemented and public available on github now

* [C# example](

[To see links please register here]

)
* [Python example](

[To see links please register here]

)
Reply

#4
maven:

[To see links please register here]

code:
Map<String, String> storages = LocalStorage.home().getForDomain("pixiv.net");
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through