Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

192
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda