Where does GM_setValue store the data to in chrome. I've tried to determine where the data is going but couldn't figure it out. I monitored with process monitor and saw that when I stored a value chrome was updating a chrome_iwoeoiifoi2h3iofhufsdfnvdf type of file and I opened that up with an sqlite browser but the data was not there. I've looked at all the recently modified files trying to find the data but could not find it.
Latest chrome/TM.
In Tampermonkey, GM_setValue()
data is stored in a LevelDB database that can be found in the User Data Directory tree.
Once in Chrome's "User Data Directory" (EG: C:\Users\USER_JOE\AppData\Local\Google\Chrome\User Data\Default\
),
navigate to the Local Extension Settings\dhdgffkkebhmkfjojejmpbldmpobfkfo
folder.
(gcalenpjmijncebpfijmoaglllgpjagf
for the Tampermonkey Beta.)
There you will find a LevelDB database, usually named CURRENT
. You can manipulate it with tools like LevelDB JSON, but external support for LevelDB currently appears to be spotty and I did not find any working tools for Windows yet (might have to compile your own).
You can also use the Chrome Storage Area Explorer extension to explore the data.
As of Tampermonkey 4.3.6, you can see an individual script's data with the Storage tab in the built-in script editor: (if the 'Storage' tab is not visible, edit Tampermonkey Settings > General Config mode > Advanced)
databases\chrome-extension_dhdgffkkebhmkfjojejmpbldmpobfkfo_0
.Once you have navigated to the correct folder, you will typically see two files. On my machine, they are currently just named 4
and 6
. These are both SQLite files (the backend for Chrome's Web SQL implementation) and can be inspected with a SQLite viewer/utility.
The (normally) larger file, 6
on my machine, is a somewhat disturbing list of 94-thousand userscripts! I'm not sure what purpose it serves, but haven't investigated it much.
The smaller file (initially, at least), 4
on my machine, is where all the information about/for your userscripts is kept. This includes any data set by GM_setValue()
.
For example, if I install and run this userscript:
// ==UserScript==
// @name _GM_setValue demo
// @match https://stackoverflow.com/questions/*
// @grant GM_setValue
// ==/UserScript==
GM_setValue ('foo', 'bar');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With