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

164
Visualizações
Access Iframe content with Javascript

I wanted to access this URL content in an iframe I checked it hasn't x-frame-options set to SAMEORIGIN But gives me this error: Blocked a frame with origin "null" from accessing a cross-origin frame.

https://s.tradingview.com/mediumwidgetembed/?symbols=BTCusdt&BTCusdt=BINANCE%3ABTCUSDT%7C12M&topColor=%23EFE7FF&lineColor=%23784ED1&chartType=area&locale=en&fontColor=%23787B86&gridLineColor=%23D3BDFF&width=100%25&height=100%25&colorTheme=light&&utm_medium=widget_new&utm_campaign=symbol-overview&showFloatingTooltip=1&showVolume=1

<body>
<iframe id="TView"
        src="https://s.tradingview.com/mediumwidgetembed/?symbols=BTCusdt&amp;BTCusdt=BINANCE%3ABTCUSDT%7C12M&amp;topColor=%23EFE7FF&amp;lineColor=%23784ED1&amp;chartType=area&amp;locale=en&amp;fontColor=%23787B86&amp;gridLineColor=%23D3BDFF&amp;width=100%25&amp;height=100%25&amp;colorTheme=light&amp;&amp;utm_medium=widget_new&amp;utm_campaign=symbol-overview&amp;showFloatingTooltip=1&amp;showVolume=1"
        style="margin:0 !important; padding: 0 !important; width: 100%; height: 450px;" frameborder="0"
        allowtransparency="true" scrolling="no"></iframe>
</body>
<script>
    let iframe = document.getElementById('TView');
    setTimeout(()=>{
        let iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
        console.log(iframeDocument)
    },1000)
</script>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It is not allowing you to load the iframe because the CSP rules of the widget domain.

Check this doc, the widget is allowing a set of domains and probably yours is not in there.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/default-src

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