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

260
Visualizações
how to ensure that a page's native javascript is generated from a trusted source?

For security reasons, I need to run native javascript code through a trusted source. Could someone tell me how I can generate a native JavaScript library to run code through it instead of the one generated by default by the page?

there's a way that a user suggested loading an <iframe> element into the page which also generates a new window element and document and then through .contentWindow and .contentDocument solves the problem, but it's still not secure because it uses the window and document objects loaded in the parent element.

Another way I've apparently found it is using the WebAssembly JavaScript API, but I still haven't figured out how to import the latest version through it.

Could someone help me generate a Native JavaScript Library in the best way possible?

Provisory solution found:

window.console.log = maliciousCode;

console.log("it's not a secure Native JavaScript");

const iframe = document.createElement('iframe');
document.body.appendChild(iframe);

iframe.contentWindow.console.log("it's more safe but still isn't a secure Native JavaScript");
about 4 years ago · Juan Pablo Isaza
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