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

177
Vistas
Chrome extension is nor running on gmail pages

I'm trying to create a chrome extension (for personal use) that will run every time I open a gmail message, however I can't seem to get the function to run in gmail pages. When I try it on other pages it runs successfully, but not on gmail. I have tried different kind of listeners and added a couple of alerts as an indication for what's running, but on gmail nothing runs at all.

Manifest:

{
    "name": "***",
    "version": "0.99",
    "manifest_version": 2,
    "content_scripts" : [
        {
            "matches": ["<all_urls>"],
            "js": ["agent.js"],
            "css": ["style.css"],
            "all_frames": true
        }   
    ],
    "icons": {
        "16": "icon16.png",
        "48": "icon16.png",
        "128": "icon16.png"
    },
    "browser_action": {
        "default_popup": "popup.html"
    }
}

agent.js:

function replaceText() {
    if ((document.body.innerHTML.search("****")) >= 0) {
        alert("Found")
        var prev = document.getElementsByTagName("table")...
        prev = prev.replace(...)
        prev = prev.replace(...)
        document.getElementsByTagName("table")... = prev
    }
}

window.addEventListener('load', function () {
    alert("Started")
    replaceText()
})

new MutationObserver(() => {
    alert("Started")
    replaceText()
}).observe(document, {subtree: true, childList: true});

chrome.tabs.onUpdated.addListener( function (tabId, changeInfo, tab) {
  if (changeInfo.status == 'complete') {
    alert("Started")
    replaceText()
  }
})
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