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

190
Visualizações
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 à 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