且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

chrome扩展程序-清单版本2

更新时间:2023-12-05 18:37:40

您需要使用本地存储在扩展程序中的jQuery文件,而不是从您的站点引用.

You need to use a jQuery file stored locally in your extension, rather than referenced from your site.

这是由于Chrome严格的内容安全政策,该政策仅允许本地脚本无需内联代码即可执行.

This is due to Chrome's strict Content Security Policy that only allows local scripts to be executed, with no inline code.

网络可访问资源是扩展中的文件可以从网络***问,而扩展程序可以访问网络上的资源.例如,如果您想使用扩展中存储的图像来更改页面的背景图像,则必须将该图像添加到清单中web_accessible_resouces中的列表中.

Web Accessible Resources are files inside your extension that may be accessed from the web, rather that resources your extension can access that are on the web. For example, if you wanted to change the background image of a page using an image stored in the extension, you have to add that image to the list in web_accessible_resouces in your manifest.

清单文件版本的更改不应影响您的内容脚本,除非它们执行了不再允许的操作.您可以从Chrome manifestVersion 文档中看到其他更改.

The change of manifest version should not affect your content scripts, unless they do something that is no longer allowed. You can see what else has changed from the Chrome manifestVersion docs.