I'm building a google chrome extension, in the run time it displays Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:". Either the 'unsafe-inline' keyword, a hash ('sha256-GnVJQ+pfVgD0VXf8ZFlSzgJaDUFRyvpUk++sBrdjNQE='), or a nonce ('nonce-...') is required to enable inline execution. when I run the code as a html page it works perfectly, but as a plugin in chrome it doesn't
<script>
function getinput(welcome)
{ var welcome = document.getElementById('welcome')
var get = document.getElementById('text')
welcome.innerHTML=get.value;
var restore = document.body.innerHTML;
var printcontent = document.getElementById('welcome').innerHTML;
document.body.innerHTML = printcontent;
window.print()
document.body.innerHTML = restore;
}
</script>
the manifest file
{
"name" : "print plugin",
"version" : "1.0",
"description" : "a simple printing plugin",
"manifest_version":2,
"browser_action" :{
"default_icon" : "icon.png",
"default_popup":"popup.html"}}