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

215
Vistas
YouTube is blocking javascript execution for around 10 seconds

I'm facing a very strange problem. I'm loading dynamically Google Charts when users are clicking on specific button. Everything works fine except that when I have YouTube videos in my page.

If I click in the first 10 seconds on one of the button that generates a chart, the chart execution is delayed. If I wait until YouTube has finished loading, the chart is loaded very fast.

I embed my videos like this:

<iframe loading="lazy" src="https://www.youtube.com/embed/WTtyAey5NCY" width="100%" height="400px" title="YouTube432"></iframe>

When loading my page, I see first those requests made by YouTube (even if the videos are not in the viewport!):

enter image description here

Those calls correspond to the videos I have in the page but after those first line, I get the following calls:

enter image description here

and then finally this:

enter image description here

When all YouTube events have finished sending data, my scripts are executed. If I try to execute scripts before the end of those events, they are put on hold until the events are completed.

In my CSP I have this:

Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.googleapis.com https://*.googletagmanager.com https://www.google-analytics.com/ https://www.google.com https://cse.google.com https://*.gstatic.com https://www.youtube.com/"

YouTube calls should not be blocked so I don't know why YouTube is doing this, it used to work one week ago. Should I block those calls with CSP? If yes, how?

Or is there something else I should do to avoid having all those calls?

Thanks Laurent

about 4 years ago · Juan Pablo Isaza
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