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

201
Vistas
Google Chrome Extension: A way to make a non-visible tab behave as if it were visible?

I am writing a Chrome extension that scrapes data from Twitter, specifically from twitter.com/following, using a content script. I want to run this in a tab/window that is not active or visible to the user, so as to not be disruptive.

Now, Twitter loads much of its content using scripts, so I am using MutationObserver and window.scrollBy to force the content to load. This works perfectly fine when the tab is visible. However, when the tab is not visible (inacive tab or window that is minimized/offscreen), it does not work. Firstly, the setInterval timers get throttled to once a second. I did some research and I think I can fix this using requestAnimationFrame, but have not tested yet. The more pressing problem is that the content that I am looking for, ie. the list of followed accounts, no longer gets loaded by Twitter's scripts.

I have tried to spoof the tab as always visible using this code snippet, but it did not fix the issue.

Object.defineProperty(document, "visibilityState", {
    get() {
        return "visible";
    }
});

document.addEventListener("visibilitychange", function(e) {
    e.preventDefault();
    e.stopPropagation();
    e.stopImmediatePropagation();
});

Is there any way to give non-visible tabs the functionality of visible tabs, if temporarily?

PS: I know that Twitter has an API, but I would prefer to not have to deal with hosting an application if I can avoid it.

about 4 years ago · Juan Pablo Isaza
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