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

166
Views
How to fetch text from an website into the javascript

i am making a chrome extension. i need a text from an open website in the active tab of browser to use in javascript of the extension. how to fetch it in there?

like in this website link in this site i want the time fetched in the javascript. i am 2 hours ago started new. Please help with an example code if anyone can.

just show an example of how to store that text in a variable. thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

for the manifest it should probably be fairly basic, you might want to restrict it to a single site and link some js to run so

manifest.json

{
    "manifest_version": 3,
    "name": "some name",
    "version": "0.0.0",
    "description": "description",

    "content_scripts": [ {
        "matches": ["https://www.utctime.net/ist-indian-time-now"],
        "js": ["main.js"]
    } ]

   
}

and the JS is pretty much getting the specific element, here it has an id named time so that can be used.

main.js

getTime = () =>{
    time = document.getElementById("time").innerHTML
    console.log(time)
}
setInterval(getTime, 100);
about 4 years ago · Juan Pablo Isaza 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!