I get the feeling I\'m missing something very obvious, but I\'ve been looking everywhere and can\'t seem to make this work. In short, I want to turn a small Javascript scrip
According to chrome extension documentation,
Inline JavaScript will not be executed. This restriction bans both inline <script>
blocks and inline event handlers (e.g. <button onclick="...">
).
Read: http://developer.chrome.com/extensions/contentSecurityPolicy.html#JSExecution
Use in popup.js as
document.addEventListener('DOMContentLoaded', function () {
document.querySelector('button').addEventListener('click', main);
});
function main() {
var source = document.getElementById('source').value;
document.getElementById("result").innerHTML = source;
}