-1

I need a JS script for Chrome extension which searches certain text in the HTML code of the page.

YouTube page of the channel contains channel id in the source code: "channelId":"UCsNGtpqGsyw0U6qEG-WHadA"

The script should find this peace of text and return only channel ID: UCsNGtpqGsyw0U6qEG-WHadA

How can I do it?

  • 1
    What did you tried, what worked, what didn't ? – Marius ROBERT May 30 '22 at 12:00
  • It's not simple. You can't just search the scripts on the page like they're text. You need to identify which object or network call that channelId key is a part of and then retrieve it yourself. Depending on the scenario, you will need to access a couple of different chrome APIs to make this happen. It's probably not something you're going to be able to get an answer to on here because it's an involved process with many files, steps and APIs. Your best best is to make an attempt and then post questions relating to specific problems you're having. – Zei May 30 '22 at 12:02

0 Answers0