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

192
Vistas
How do I find the URL of an ad on YouTube in JavaScript?

I'm currently making a browser extension, and I need it to find the URL of an ad that is on the screen playing in YouTube. How can I do this in JavaScript?

I've found something called 'adVideoId' in the body tag of a page containing a video ad, which I think is a JavaScript object variable, but I can't seem to actually extract its value.

Note: the 'adVideoId' is at the end of the code below.

<body dir="ltr" standardized-themed-scrollbar=""><div id="watch7-content" class="watch-main-col" itemscope="" itemid="" itemtype="http://schema.org/VideoObject"><link itemprop="url" href="https://www.youtube.com/watch?v=l1YwPDTsLJ"><meta itemprop="name" content="I Went UNDERCOVER in a Tournament!"><meta itemprop="description" content="Undercover in a Raider Only! SUBSCRIBE &amp; CLICK THE BELL! 🔔Merch: https://..."><meta itemprop="videoId" n27r_zAhXjp1EKHZpXDrI="}},"hoverText":{"simpleText":"Why this ad?"},"trackingParams":"CDgQs-4CIhMIrdfp9u6_8wIV46dRCh2aVw6y"}},"adVideoId":"d40g6ewFE-k","impressionPings":[{"base
var ytInitialPlayerResponse = {"responseContext":{"serviceTrackingParams [shortened here because it is ridiculously long] "adVideoId":"sEVvXIQ_DLY"
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