GM_setValue在哪里存储数据? [英] Where does GM_setValue store data?

查看:1812
本文介绍了GM_setValue在哪里存储数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GM_setValue将数据存储在chrome中。我试图确定数据在哪里,但无法弄清楚。我使用进程监视器进行监视,并看到当我存储值时,chrome正在更新chrome_iwoeoiifoi2h3iofhufsdfnvdf类型的文件,并且我用sqlite浏览器打开了该文件,但数据不在那里。我查看了所有最近修改过的文件,试图找到数据但找不到它。



最新chrome / TM。


<在Tampermonkey中, GM_setValue()数据存储在












老年人,2015年11月至2015年: h2>


  • 在2015年11月左右之前,数据存储在



    你想要的是 @st 行。注意它是如何编码的 GM_setValue 数据? :




    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:




    OLD, Pre November-ish 2015:

    • Before, about November 2015, data was stored in a Web SQL database in 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');
    


    And then I inspect the config table in file 4, I will see four entries like this:


    The one you want is the @st row. Notice how it has the GM_setValue data encoded? :

    这篇关于GM_setValue在哪里存储数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆