Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

200
Vistas
Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self'"

My Html file looks like below. When I launch the HTML file it says, content security policy is broken. How do I fix it from the HTML side?

<html>

<head>

  <title></title>
</head>
<script type="text/javascript" src="URLCode.js"></script>

<body onload='window.location.replace(URLalter(window.location.href));'>
</body>

</html>

Js code:

function URLalter(entryURL) {
  var entryPoint= entryURL+" ";
  return entryPoint;
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

How do I fix it from the HTML side?

Easy answer, you don't. The server is most definitely responsible for this and with good reason but let's say those reasons are simply security. You may bypass this by adjusting your headers but it will not be done on a client level side at all!

That's bad.

You can maybe get comfortable with these security features often applied and understand the different headers/measures taken: contentSecurityPolicy, dnsPrefetchControl, expectCt, frameguard, hidePoweredBy, hsts, ieNoOpen, noSniff, permittedCrossDomainPolicies, referrerPolicy, and xssFilter

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda