Answer the question
In order to leave comments, you need to log in
Why doesn't click listener work in chrome extensions?
//poupop.js
document.addEventListener('DOMContentLoaded',function(){
var clickClearLocal= document.getElementById('btnClearLocalStr');
clickClearLocal.addEventListener('click',function(){
alert('r');
// chrome.storage.local.remove('channels');
},false);
});
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Потерянное время LostTime</title>
<link href="css.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="options"><!-- меню -->
<h3>first app</h3>
<div id="btnClearLocalStr">
Очистить буфер
</div>
</div>
<div id="dannie"></div> <!-- в этот блок буду загружать данные, которые будут показываться пользователю-->
<script src="popup.js"></script><!-- скрипт, выполняющийся при нажатии на иконку расширения-->
</body>
</html>
{
"manifest_version": 2,
"name": "Help Panda",
"version": "2.0",
"icons": {
"128": "panda.png"
},
"content_scripts": [
{
"matches": [ "*://*/*" ],
"js": [ "content.js" ]
}
],
"background": {
"scripts": ["background.js"]
},
"permissions": [
"webNavigation",
"notifications",
"tabs",
"storage"
],
"browser_action": {
"default_title": "Help Panda",
"default_icon": "panda.png",
"default_popup": "popup.html"
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question