Answer the question
In order to leave comments, you need to log in
The function in the chrome app does not work, why?
Here is background.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('index.html', {
'outerBounds': {
'width': 400,
'height': 500
}
});
});
{
"manifest_version": 2,
"name": "Codelab",
"version": "1",
"icons": {
"128": "icon_128.png"
},
"permissions": [],
"app": {
"background": {
"scripts": ["background.js"]
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>test</title>
<script src="js.js"></script>
</head>
<body>
<button id="b" type="button">click me</button>
</body>
</html>
document.addEventListener('DOMContentLoaded', function () {
function f(){
alert("Привет")
}
document.getElementById("b").addEventListener('click', f);
})
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