Javascript Chrome/Tampermonkey 用户脚本存储在文件系统的何处?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11850460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 07:22:48  来源:igfitidea点击:

Where are Chrome/Tampermonkey userscripts stored on the filesystem?

javascriptgoogle-chromeuserscriptstampermonkey

提问by Landon Kuhn

Where are Chrome/Tampermonkey userscripts stored on the filesystem?

Chrome/Tampermonkey 用户脚本存储在文件系统的何处?

I want to edit user scripts directly instead of using the hokey in-browser editor.

我想直接编辑用户脚本,而不是使用 hokey 浏览器内编辑器。

采纳答案by Brock Adams

Tampermonkey scripts are super easy to update via the Tampermonkey tab. See the Tampermonkey FAQ, or just try it.

通过 Tampermonkey 选项卡更新 Tampermonkey 脚本非常容易。请参阅Tampermonkey 常见问题解答,或尝试一下。

Tampermonkey scripts were stored in a special SQLite database and were/are not directly editable in file form.
Update:As of version 3.5.3630, Tampermonkey scripts are now stored using Chrome's extension storage. They are still not editable in file form, but the developer of Tampermonkey (derjanb) has helpfully made a Python script to extract them.

Tampermonkey 脚本存储在一个特殊的 SQLite 数据库中,不能直接以文件形式编辑。
更新:版本 3.5.3630 开始,Tampermonkey 脚本现在使用 Chrome 的扩展存储进行存储。它们仍然无法以文件形式进行编辑,但 Tampermonkey (derjanb) 的开发人员已经帮助制作了一个 Python 脚本来提取它们。



Chrome Userscripts(not the same as Tampermonkey scripts) are stored as follows, for the Chrome and Chromium browsers:

Userscripts(不一样的Tampermonkey脚本)存储如下,对于Chrome和铬的浏览器:

Windows XP:
  Chrome  : %AppData%\..\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions\
  Chromium: %AppData%\..\Local Settings\Application Data\Chromium\User Data\Default\Extensions\  

Windows Vista/7/8:
  Chrome  : %LocalAppData%\Google\Chrome\User Data\Default\Extensions\
  Chromium: %LocalAppData%\Chromium\User Data\Default\Extensions\

Linux:
  Chrome  : ~/.config/google-chrome/Default/Extensions/
  Chromium: ~/.config/chromium/Default/Extensions/

Mac OS X:
  Chrome  : ~/Library/Application Support/Google/Chrome/Default/Extensions/
  Chromium: ~/Library/Application Support/Chromium/Default/Extensions/

See this answeror this Google Groups thread.
Note that Chrome userscripts are automatically made into Chrome extensions with an auto-generated manifest.

请参阅此答案此 Google 网上论坛线程
请注意,Chrome 用户脚本会自动生成带有自动生成清单的 Chrome 扩展程序。

However:

然而:

  1. Editing these files in place will not work. Chrome ignores and/or overwrites the changes.
  2. For Userscripts, set up your environment as in this answer, for easy editing and updating.
  3. Tampermonkey scriptsare not stored the same way. They are stored, by Tampermonkey in a special SQLite database and are not directly editable that way.UPDATE: This was changed with version 3.5.3630, or so. See above.
  1. 就地编辑这些文件将不起作用。Chrome 会忽略和/或覆盖更改。
  2. 对于用户脚本,请按照此答案设置您的环境,以便于编辑和更新。
  3. Tampermonkey 脚本的存储方式不同。 它们由 Tampermonkey 存储在一个特殊的 SQLite 数据库中,不能直接编辑。更新:这在版本 3.5.3630左右发生了变化。看上面。