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

374
Visualizações
How can I grab the title of a YouTube video using javascript with no YouTube API?

I am making a chrome extension and I need to grab the title of youtube videos. I don't want to use the youtube api.

Here is the code in my content script

about 4 years ago · Santiago Gelvez
3 Respostas
Responde à pergunta

0

Solved it by doing var videotitle = document.title.split(" - YouTube")[0];

about 4 years ago · Santiago Gelvez Relatório

0

You can grab the tab title in the background.js, it will return the youtube video title

chrome.tabs.onActivated.addListener(function (activeInfo) {
chrome.tabs.get(activeInfo.tabId, function (tab) {
    console.log("Title: " + tab.title);
});

});

about 4 years ago · Santiago Gelvez Relatório

0

You can also use this line of code in the F12 developer tools:

ytInitialPlayerResponse.videoDetails.title

The same line of code should work on your extension as well.

about 4 years ago · Santiago Gelvez 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