Problem description:
When developing a Chrome extension, when js is required in the popup.html of the page, directly writing JS in dynamically bound JS events will prompt:
Refused to execute inline script because it violates the following Content Security Policy directive: “script-src 'self' chrome-extension-resource:”..
Solution:
Reference external js in popup.html The file dynamically binds JS events, for example: