Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

171
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda