I am making a chrome extension, but when I try to get user input, and subsequently load the page, it throws an error:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem:". Either the 'unsafe-inline' keyword, a hash ('sha256-FXypLyAT7wJfhWBTVrCbeUAS8Y801HSs7d9LQUHi6aQ='), or a nonce ('nonce-...') is required to enable inline execution.
popup.html:
<!doctype html>
<html>
<head>
<script>
function connect() {
console.log(document.getElementById('url').value);
var urlValue = document.getElementById('url').value;
chrome.tabs.update({
url: urlValue
});
}
</script>
</head>
<body>
<input type="url" name="url" id="url" placeholder="http://google.com" required></input>
<button onclick="connect()">Connect</button>
</body>
</html>
manifest.json:
{
"manifest_version": 2,
"name": "extension",
"description": "extension",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
]
}