Add-on is not running due to CSP

(Isabeltiongsk) #1

Hi, recently I try to make an add on for firefox. When I tested the files everything is running fine. But when I add it as extension, the feature popup with the html but the function is not running and I got this error
“Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src”). Source: onsubmit attribute on DIV element.”

I try to search online but have no idea what CSP header is and how to enable can anyone guide me please?

(Martin Giger) #2

You should not change the CSP to allow inline script (I don’t think you even can). Instead you should use addEventListener in JS to attach your submit listener.