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

149
Vistas
Chrome scripting in all subframes

I'm trying to get a script to execute in all tabs and it seems to conditionally work. It works on pages without frames, but on pages with frames and subframes it fails to execute. Here's an example:

This seems to be no problem

This does...

I'm sure that it's something about the activeTabs permissions in the manifest.json file, but as of now, I'm lost. I'm so close to building the extension that I want, but this stops the whole thing. I'd appreciate any advice people have!

Here's the code to trigger the function:

document.getElementById('red').onclick = () => {chrome.tabs.query({},(tabs) => {
    for(var i = 0; i < tabs.length; i++) {
        chrome.scripting.executeScript({
            target:{tabId:tabs[i].id, allFrames: true},
            function: setBackGroundColorRed
            });
    }
    });
}

...and here's the function:

function setBackGroundColorRed(){
    document.body.style.backgroundColor= 'red';
}

I really could use a hand. Thanks folks!

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