Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

373
Views
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 answers
Answer question

0

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

about 4 years ago · Santiago Gelvez Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!