Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
Is there a way to log asset load errors on non-async assets when using a CSP with nonces for scripts?

Because enabling use of nonces in CSP disables event handlers, it's not possible to add an onerror property to script tags to handle/report asset load issues.

Is there a recommended way to handle this? Particularly for script tags which are not loaded async.

Thanks!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If you dynamically load an external script, you can hang CSP-safe event listeners:

let script = document.createElement('script');

script.src = "https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.3.0/lodash.js"
document.head.append(script);

script.addEventListener('error', function(e) {
    // handle onerror event here
    });
about 4 years ago · Juan Pablo Isaza Report

0

try creating a separate service that only purpose to monitor, handle, and report/display errors.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!