Javascript 复选框on off不适用于chrome扩展?
我的默认复选框被选中,当我单击取消选中时,它不工作,只需关闭按钮但不工作,在我关闭弹出窗口后,当我再次看到buton仍处于打开状态,因此被选中时,我如何解决此问题?这个脚本有错误吗 popup.htmlJavascript 复选框on off不适用于chrome扩展?,javascript,jquery,html,checkbox,manifest.json,Javascript,Jquery,Html,Checkbox,Manifest.json,我的默认复选框被选中,当我单击取消选中时,它不工作,只需关闭按钮但不工作,在我关闭弹出窗口后,当我再次看到buton仍处于打开状态,因此被选中时,我如何解决此问题?这个脚本有错误吗 popup.html <html> <head>> <link rel='stylesheet' href="css/popup.css"/> <script type="text/javascript" src="js/popup.js"&g
<html>
<head>>
<link rel='stylesheet' href="css/popup.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<div style="padding: 10px;">
<div style="float:left;"> Players </div>
<div class="flipswitch">
<input type="checkbox" name="flipswitch" class="flipswitch-cb cbox" id="fs" checked>
<label class="flipswitch-label" for="fs">
<div class="flipswitch-inner"></div>
<div class="flipswitch-switch"></div>
</label>
</div>
</div>
</body>
</html>
manifest.json
"name":"test",
"description":"test",
"version":"1.1.1",
"manifest_version":2,
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"browser_action": {
"default_title": "name",
"default_popup": "popup.html",
"default_icon": "icons/icon128.png"
},
"background": {
"scripts": ["js/background.js"],
"persistent": true
},
"content_scripts": [
{
"js": ["js/content.js", "js/jquery.js"],
"matches": ["<all_urls>"],
"run_at": "document_end",
"all_frames": true
}
],
"applications": {
"gecko": {
"id": "{3b5e61ae-bda1-46c5-89bb-5085cc5ee9c}",
"strict_min_version": "57.0"
}
},
"content_security_policy": "script-src 'self'",
"permissions": [
"webRequestBlocking",
"unlimitedStorage",
"webNavigation",
"<all_urls>",
"webRequest",
"activeTab",
"downloads",
"topSites",
"storage",
"cookies",
"tabs"
]
}
“name”:“test”,
“说明”:“测试”,
“版本”:“1.1.1”,
“清单版本”:2,
“图标”:{
“16”:“icons/icon16.png”,
“48”:“icons/icon48.png”,
“128”:“icons/icon128.png”
},
“浏览器操作”:{
“默认标题”:“名称”,
“默认弹出窗口”:“popup.html”,
“默认图标”:“icons/icon128.png”
},
“背景”:{
“脚本”:[“js/background.js”],
“持久”:正确
},
“内容脚本”:[
{
“js”:[“js/content.js”,“js/jquery.js”],
“匹配项”:[“”],
“运行时间”:“文件结束时间”,
“所有帧”:正确
}
],
“应用程序”:{
“壁虎”:{
“id”:“{3b5e61ae-bda1-46c5-89bb-5085cc5ee9c}”,
“严格的最低版本”:“57.0”
}
},
“内容安全策略”:“脚本src'self',
“权限”:[
“webRequestBlocking”,
“无限制存储”,
“网络导航”,
"",
“网络请求”,
“活动标签”,
“下载”,
“表土”,
“存储”,
“饼干”,
“选项卡”
]
}
"name":"test",
"description":"test",
"version":"1.1.1",
"manifest_version":2,
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
},
"browser_action": {
"default_title": "name",
"default_popup": "popup.html",
"default_icon": "icons/icon128.png"
},
"background": {
"scripts": ["js/background.js"],
"persistent": true
},
"content_scripts": [
{
"js": ["js/content.js", "js/jquery.js"],
"matches": ["<all_urls>"],
"run_at": "document_end",
"all_frames": true
}
],
"applications": {
"gecko": {
"id": "{3b5e61ae-bda1-46c5-89bb-5085cc5ee9c}",
"strict_min_version": "57.0"
}
},
"content_security_policy": "script-src 'self'",
"permissions": [
"webRequestBlocking",
"unlimitedStorage",
"webNavigation",
"<all_urls>",
"webRequest",
"activeTab",
"downloads",
"topSites",
"storage",
"cookies",
"tabs"
]
}