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

165
Visualizações
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 Respostas
Responde à pergunta

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 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