Chrome扩展程序JQuery无法加载

时间:2018-01-04 15:07:35

标签: javascript jquery html json google-chrome-extension

我正在尝试制作一个扩展程序,当用户单击按钮但未加载JQuery文件时,该扩展程序会更改任何网站上的每个图像。



$("#change").click(function(){
     $("img").attr("src", "https://image.flaticon.com/teams/slug/freepik.jpg");
});

{
"manifest_version": 2,

"name": "Getting started example",
"description": "example",
"version": "1.0",

"content_scripts": [{
"js": ["changeIMG.js", "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"],
"matches": ["http://*/*", "https://*/*"]
}],

"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
]


}

<!DOCTYPE html>
<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

</head>
<body>

<button id="change">Click</button>

<script src="changeIMG.js"></script>

</body>
</html>
&#13;
&#13;
&#13;

我做错了什么?

0 个答案:

没有答案