Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Get URL of a current tab using Firefox 57 in an addon

This is my manifest file: {

 "description": "Test",
 "permissions": ["tabs"],
 "manifest_version": 2,
 "name": "Test",
 "version": "1.0",
 "background": {
   "scripts": ["background.js"]
 },
    "applications": {
     "gecko": {
        "id": "test@test.com"
     }
  },
  
 "browser_action": {
   "default_icon": {
     "16": "icons/icon.png",
     "32": "icons/icon.png",

"48": "icons/icon.png"

   }
 }

}

For some reason, attempting to use browser.tabs.Tab won't work. It just returns "undefined". It seems that the tabs permission isn't being given to background.js for some reason.

This is my manifest file: { "description": "Test", "permissions": ["tabs"], "manifest_version": 2, "name": "Test", "version": "1.0", "background": { "scripts": ["background.js"] }, "applications": { "gecko": { "id": "test@test.com" } }, "browser_action": { "default_icon": { "16": "icons/icon.png", "32": "icons/icon.png", "48": "icons/icon.png" } } } For some reason, attempting to use browser.tabs.Tab won't work. It just returns "undefined". It seems that the tabs permission isn't being given to background.js for some reason.

所有回覆 (1)

This support forum focuses on end user issues. Could I suggest taking your question over to the Add-ons forum:

https://discourse.mozilla-community.org/c/add-ons