Hello World
Hello World

Reputation: 840

Javascript does not work in Chrome extensions

Inside chrome-extension://<EXTENSION_ID>/hello.html, the following code:

<script> alert("hi"); </script>

JS does not work? How to make it work?

Upvotes: 0

Views: 494

Answers (1)

Xan
Xan

Reputation: 77482

You cannot use inline JavaScript in a Chrome extension as per enforced Content Security Policy.

You will need to get rid of it, by placing it in an external JS file.

Upvotes: 1

Related Questions