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

185
Views
El script se ejecuta en segundo plano sin esperar la entrada

así que logré que mi secuencia de comandos funcionara incluso cuando la ventana emergente está cerrada, pero la secuencia de comandos no reacciona en el botón, sigue actualizando el sitio, ¿podrían ayudarme y decirme qué está mal en este background.js? Tengo content.js y archivo html separados.

 function startref() { let intervalId = setInterval(function () { chrome.tabs.query({ active: true, currentWindow: true }, function (arrayOfTabs) { var code = 'window.location.reload();'; chrome.tabs.executeScript(arrayOfTabs[0].id, { code: code }); }); }, 3000); localStorage.setItem('refresh', intervalId); } function stop() { const intervalId = localStorage.getItem("refresh"); clearInterval(intervalId); } window.onload = function () { var sta = document.getElementById("startbtn"); var sto = document.getElementById("stopbtn"); document.addEventListener('DOMContentLoaded', function () { sta.addEventListener('click', startref); }); document.addEventListener('DOMContentLoaded', function () { sto.addEventListener('click', stop); }); if (localStorage.getItem("refresh")) { startref(); } };
about 4 years ago · Juan Pablo Isaza
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!