Closed mLiGuangYuan closed 10 months ago
It looks like that's what caused it. content-security-policy-refused-to-execute-inline-event-handler-error
It seems that the browser extension imposes stricter restrictions in CSP. I tried placing an empty popup.html
page and setting the content in the manifest.json,
{
// ... others
"content_security_policy": {
"extension_pages": "script-src 'unsafe-inline'"
},
}
but when attempting to load, it resulted in an error 'content_security_policy.extension_pages': Insecure CSP value "'unsafe-inline'" in directive 'script-src'
.
From the behavior, it may not be the appropriate time to load PageSpy
in the extension. Besides that the PageSpy SDK relies on Modernizr, which might trigger additional CSP rules, such as detecting the oninput event.
Describe the bug
I want to do bug tracking and online debugging in my chrome extension, and register it within its background.html, I'm inject
page-spy/index.min.js
, but I encounter the following errorThe current form of HTMLElement Event script injection is insecure and does not comply with the content security policy standard, is there any good solution or way to improve it?
Steps to reproduce
No response
System Info
Logs
No response
Validations