Google chrome extension chrome扩展内容脚本如何在软件包应用程序上运行
我正在制作一个chrome软件包应用程序。这是我的manifest.jsonGoogle chrome extension chrome扩展内容脚本如何在软件包应用程序上运行,google-chrome-extension,content-script,Google Chrome Extension,Content Script,我正在制作一个chrome软件包应用程序。这是我的manifest.json "app": { "launch": { "local_path": "main.html" } "content_scripts": [ { "matches": ["http://*/*", "https://*/*", "file://*/*"], "js": ["jquery-1.7.min.js", "content_script.js"], "all_frame": "true" }
"app": {
"launch": {
"local_path": "main.html"
}
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*", "file://*/*"],
"js": ["jquery-1.7.min.js", "content_script.js"],
"all_frame": "true"
}
为什么我的内容脚本不能在main.html上运行?内容脚本可以在软件包应用程序上运行吗?内容脚本不能在
chrome扩展:
protocol[]上运行。因此,内容脚本将不会在您的应用程序上运行
将脚本包括在main.html
中:
<script src="jquery-1.7.min.js"></script>
<script src="content_script.js"></script>
[]:唯一允许的协议是
http:
、https:
和文件:
。对于所有其他协议,即使指定了
,也不会注入内容脚本。内容脚本不能在chrome扩展:
协议[]上运行。因此,内容脚本将不会在您的应用程序上运行
将脚本包括在main.html
中:
<script src="jquery-1.7.min.js"></script>
<script src="content_script.js"></script>
[]:唯一允许的协议是
http:
、https:
和文件:
。对于所有其他协议,即使指定了
,也不会注入内容脚本。那么脚本只是一个脚本,而不是chrome扩展的内容脚本?并且无法传递消息?@user1070827扩展页中的脚本可以完全访问chrome.*
API。内容脚本在页面和扩展之间的环境中运行:内容脚本可以访问页面中的任何窗口
对象,并且只能访问部分方法。因此,脚本只是一个脚本,而不是chrome扩展的内容脚本?并且无法传递消息?@user1070827扩展页中的脚本可以完全访问chrome.*
API。内容脚本在页面和扩展之间的环境中运行:内容脚本可以访问页面中的任何窗口
对象,并且只能访问部分方法。