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

154
Views
Chrome extension to Firefox extension

I have developed a Chrome extension On Chrome everything works as I expect

I am now trying to migrate the extension to Firefox

It tells me that the developed extension is compatible with Firefox (I used this link https://www.extensiontest.com/)

However, I have some problems I have a devtools_script ("VariableGrid.js") which sends messages to the ContentScript via chrome.tabs.query

chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.tabs.sendMessage(chrome.devtools.inspectedWindow.tabId, { from: "FromExample", message: "MessageExample" }, (response) => {
......
});
});

My ContentScript replies to the message like this

chrome.runtime.onMessage.addListener(
(request, sender, sendResponse) => {
......
});

On Firefox chrome.tabs is undefined I tried using browser.tabs but it's the same

I read that tabs can only be used on background script

Why does this work on my Chrome extension and not on Firefox?

If I tried to move that piece of code to the background script I would still have a problem:

chrome.devtools.inspectedWindow.tabId is undefined

my Manifest is like this

 {
  "browser_specific_settings": {
    "gecko": {
      "id": "addon@example.com",
      "strict_min_version": "42.0"
    }
  },
  "name": "xxxx",
  "description": "xxxx",  
  "version": "0.0.0.1",
  "browser_action": {
      "default_popup": "Popup.html"
  },
  "manifest_version": 2,
  "background": {
    "scripts":["jquery.min.js", "background.js"],
    "persistent": true
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["jquery.min.js", "Content.js"]
    }
  ],  
  "web_accessible_resources": [
    "Content.js"
  ],
  "devtools_page": "Devtools.html",
  "permissions": [
    "webRequest",
    "webRequestBlocking",
        "tabs",
        "activeTab",
        "notifications",
        "storage",
        "http://*/",
        "https://*/",
        "<all_urls>"
  ]
}
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!