Safari: how to catch CSP exceptions
I am creating a website and I already have the corresponding CSP headers created. In my code, I have a line in the following form:
<object id="some_id" data="some_data" onerror="some_stuff"></object>
"some_data" will break my CSP settings, so an exception will be thrown. On Chrome, this will call an event handler, which will trigger "some_stuff". However, this does not happen in Safari, although this exception was thrown when I check the inspector. May I know what I need to do to catch this CSP exception? I want to be able to run some code as soon as this exception has been caught.
Thank!
+3
source to share
No one has answered this question yet
Check out similar questions: