esq*_*qew 45 google-chrome-extension
我如何在我的谷歌Chrome内容脚本中包含jQuery库?当然,我已经毫无结果地尝试过.我应该使用<script src="..." /></script>,还是有不同/更好的方式去做?提前致谢!
Gra*_*ant 67
把它放到你的背景html中并没有你想要的.您需要在manifest.json中提及它,如下所示:
{
"name": "MyExtension",
"version": "0.1",
"description": "blah blah",
"background_page": "background.html",
"content_scripts": [
{
"matches": ["http://*/*","https://*/*"],
"css": ["extension.css"],
"js": ["jquery-1.4.2.js", "extension.js"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
28068 次 |
| 最近记录: |