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

178
Views
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
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!