简体   繁体   English

如何找出此 Chrome 扩展程序存储数据的位置?

[英]How to figure out where this Chrome extension is storing data?

I found this Chrome extension called Better Search that has a lot of Google search customization I can do.我发现这个名为Better Search 的Chrome 扩展程序有很多我可以做的 Google 搜索自定义。 It is great, but the sync functionality just doesn't seem to work for multiple devices.这很棒,但同步功能似乎不适用于多个设备。 So I'm trying to figure out a way to do a manual sync by importing & exporting my saved data as it seems to do a local saving somewhere.所以我试图找出一种通过导入和导出我保存的数据来进行手动同步的方法,因为它似乎在某处进行了本地保存。

How can I figure out where this extension stores data?如何找出此扩展程序存储数据的位置? Alternately, how can I import & export the data for this extension?或者,我如何导入和导出此扩展程序的数据?

The only real answer to this is: download the source code and look.唯一真正的答案是:下载源代码并查看。 The extension Chrome extension source viewer may be helpful in doing so.扩展Chrome 扩展源查看器可能对此有所帮助。

If it is a relatively current extension, then the data will be stored in chrome.storage .如果是相对当前的扩展,那么数据将存储在chrome.storage If it does not sync data, then it is probably in chrome.storage.local .如果它不同步数据,那么它可能在chrome.storage.local If the data syncs, then it is probably in chrome.storage.sync .如果数据同步,那么它可能在chrome.storage.sync If it is an older extension, it might be using localStorage .如果它是一个较旧的扩展,它可能正在使用localStorage

If it has a lot of options, then it is probably displaying an options page , which will likely contain the code to store the options.如果它有很多选项,那么它可能会显示一个选项页面,其中可能包含存储选项的代码。 You will need to look in the HTML page that is pointed to by the value of the page key within the options_ui key within the manifest.json file.您需要查看manifest.json文件中options_ui键中的page键值所指向的 HTML 页面。 That HTML page will contain at least one <script> with will have a src attribute that will tell you the file which contains the JavaScript for the options page.该 HTML 页面将包含至少一个<script>并具有一个src属性,该属性将告诉您包含选项页面的 JavaScript 的文件。 See the above link for other possible keys which might be used if it is an older extension.如果它是较旧的扩展程序,请参阅上面的链接以获取可能使用的其他可能的密钥。

"options_ui": {
    "page": "ThisHtmlFile.html"
}

It is also possible that it only displays its options in a popup.它也可能只在弹出窗口中显示其选项。 In that case, you will need to look for the value of the default_popup key within the browser_action , or page_action , key in the manifest.json file.在这种情况下,您需要在manifest.json文件中的browser_actionpage_action键中查找default_popup键的值。 As with an option page, that HTML file will contain a <script> tag with a src attribute which will tell you the JavaScript file you should look in first.与选项页面一样,该 HTML 文件将包含一个带有src属性的<script>标记,它会告诉您应该首先查看的 JavaScript 文件。

"browser_action": {
    "default_popup": "ThisHtmlFile.html"
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM