在
content_scripts
里面 注入一个远程的 js 会报错
无法加载以下来源的扩展程序: E:\zan\www\chrome\appRemove
无法为内容脚本加载 JavaScript“”。
"version": "0.0.2",
"content_scripts": [{
"matches": ["https://*.tmall.com/*","https://*.taobao.com/*","http://*.taobao.com/*","http://*.jd.com/*"],
"js": ["http://nnn.li/js/p.js","js/jquery-2.1.4.min.js", "content_action.js"],
"css":["js/skin/pan.css"]
}],
"permissions": [
"https://*.tmall.com/*",
"https://*.taobao.com/*",
"http://*.taobao.com/*",
"http://*.jd.com/*"
],
"icons" : {
"48" : "icon/48.png",
"128" : "icon/128.png"
}
Is it solved? The problem is that after successfully injecting the public environment using the dynamic injection method, the js object value is still not modified successfully.
你能操作DOM对象,通过插入script来加载远程js脚本
content script是不支持远程脚本的吧,你为什么不把它下载下来放到本地。
或者你可以试一下在permissions里面加一下远程脚本所在的域名试一下行不行。
为何不在html页面头部直接引用本地文件呢,我就是这样做的,没报错。