I have a chrome extension that I recently migrated to manifest V3.
My extension bundles all required code, and so has a CSP setting of:
"content_security_policy": {
"extension_pages" : "script-src 'self'; object-src 'self'"
},
The extension is a content script running on a target site that I do not control, and at one point clicks a link on the page. The link has some inline javascript on the href, e.g:
<a href="javascript:__doPostBack('some args')">Link Text</a>
My extension locates the link using jquery, and then calls linkElement.click() to trigger the click. When it does this, I get CSP errors saying:
Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "script-src 'self' object-src 'self'"
This was NOT a problem on manifest V2, it all worked fine.
This seems wrong to me. The inline code violation is on the target site, not my extension. All the extension is doing is clicking a DOM element.. Surely at that point it should just hand over to the target site to do it's thing.. It doesn't feel right that the target site code can break my extension's CSP policy.
Can anyone help?
Thanks
John