问题描述
据我所知,个人数据始终保存在个人资料路径中,可以在chrome://版本中找到。
As I know , personal data always be saved at profile path which can be find at chrome://version.
我在Chrome Dev Tool中添加了许多代码段,并希望对它们进行备份。
I added many snippets in my Chrome Dev Tool, and want to backup them .
但我无法找到一个文件,该文件会将保存在此路径下的数据片断化。
But I cann't find a file that snippets data saved in under this path.
有谁知道?请告诉我 。非常感谢!
Does anyone knows ? Plz tell me . Thanks very much!
推荐答案
自Chrome 47(或其他)以来,通过localStorage不再提供片段。此外,natchiketa的答案依赖于localStorage,也不再工作。
As of Chrome 47 (or so), snippets are no longer available via localStorage. Also, natchiketa's answer is dependent on localStorage and also doesn't work any longer.
以下是目前的技巧:
获得片段
Below is the current technique:
InspectorFrontendHost.getPreferences(_ => console.log(JSON.parse(_.scriptSnippets)))
设置片段
setting snippets
InspectorFrontendHost.setPreference("scriptSnippets", JSON.stringify(yourSnippets))
这项技术是从讨论这一变化。
This technique was extracted from a github thread discussing this change.
这篇关于Chrome Dev Tool的片段保存在哪个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!