我可以将 Mootools 框架包含在 Chrome 扩展的后台页面中吗?
如标题,我想知道是否可以将 Mootools 框架包含到 Chrome 扩展的后台页面中? 我尝试过但没有成功。
背景页:
<!doctype html>
<html>
<head>
<title>Background Page</title>
<script src="mootools-more-1.4.0.1.js" type="text/javascript"></script>
<script src="mootools-core-1.4.2-full-compat.js" type="text/javascript"></script>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
清单:
{
"name": "First Extension",
"version": "1.0",
"description": "The first extensione tha I made",
"permissions":["contextMenus"],
"background_page": "background_page.html",
"browser_action":{
"name": "My First Extension!",
"default_icon": "Chrome_icon32bn.png",
/*"default_popup": "popup.html",*/
"default_title": "My First Extension!"
},
"icons": {
"16": "Chrome_icon19color.png",
"48": "Chrome_icon32color.png",
"128": "Chrome_icon.png"
},
"content_scripts": [{ "js": ["https://ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"] }]
}
As title, I would know if can I include Mootools framework into background page of Chrome Extension?
I tried but without success.
Background page:
<!doctype html>
<html>
<head>
<title>Background Page</title>
<script src="mootools-more-1.4.0.1.js" type="text/javascript"></script>
<script src="mootools-core-1.4.2-full-compat.js" type="text/javascript"></script>
<script src="script.js"></script>
</head>
<body>
</body>
</html>
Manifest:
{
"name": "First Extension",
"version": "1.0",
"description": "The first extensione tha I made",
"permissions":["contextMenus"],
"background_page": "background_page.html",
"browser_action":{
"name": "My First Extension!",
"default_icon": "Chrome_icon32bn.png",
/*"default_popup": "popup.html",*/
"default_title": "My First Extension!"
},
"icons": {
"16": "Chrome_icon19color.png",
"48": "Chrome_icon32color.png",
"128": "Chrome_icon.png"
},
"content_scripts": [{ "js": ["https://ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js"] }]
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,但由于扩展程序运行时您处于沙箱中,因此必须以不同方式加载它:
将其添加到清单中
Yes but because you are in a sandbox when the extension is running you must load it differently:
Add this to the manifest