Hi I have run into a very weird problem.
I have a basic chrome extension which has a default popup.html document defined as follows:
<html>
<head>
<script type="text/javascript">
function disp() {
document.getElementById("test").innerHTML = "Bye";
}
</script>
</head>
<body>
<p id="test">Hello</p>
<button type="button" onclick="disp()">'Twas Nice to meet you</button>
</body>
</html>
Upon running the html file independently in a browser, it behaves as expected: clicking on the button changes the text of the p tag. However, from withing the chrome extension, in the popup the button does not seem to respond
Is this something to do with popups in general or something specific to my code?
Although you’ve found out you can circumvent the inline script “issue” (it is a security feature), below is what it would look like if you did not do that. This shows both how to call a notification and a “window”-based dialog.
manifest.json
popup.html
dialog.html
popup.js
You can find the files to download here:
http://jfcoder.com/projects/chrometestdialogs/