Join the Mozilla’s Test Days event from 9–15 Jan to test the new Firefox address bar on Firefox Beta 135 and get a chance to win Mozilla swag vouchers! 🎁

ค้นหาฝ่ายสนับสนุน

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

เรียนรู้เพิ่มเติม

Develop android firefox addon to query all tabs issue

  • ยังไม่มีคำตอบ
  • 0 คนมีปัญหานี้
more options

I developed an Android Firefox addon and tried to print out all the tabs information in Firefox on the PC. As a result, I could only get the information of the current tab. Is there a way for me to get the information of all tabs? Here is my code:

background.js browser.browserAction.onClicked.addListener(() => {

 browser.tabs.query({}).then((tabs) => {
   tabs.forEach((tab) => {
     console.log(`Tab ID: ${tab.id}, Title: ${tab.title}, Index: ${tab.index}`);
   });
 });

});

manifest.json {

 "manifest_version": 2,
 "name": "Close Tabs ",
 "version": "1.0",
 "description": "Clsoe Tabs ",
 "permissions": ["tabs"],
 "background": {
   "scripts": ["background.js"],
   "persistent": false
 },
 "browser_action": {
   "default_icon": {
     "16": "icons/icon-16.png",
     "48": "icons/icon-48.png",
     "128": "icons/icon-128.png"
   },
   "default_title": "Close Tabs "
 }

}

My pc firefox version is 134.0.1, With firefox nightly for android version 134.0a1

I developed an Android Firefox addon and tried to print out all the tabs information in Firefox on the PC. As a result, I could only get the information of the current tab. Is there a way for me to get the information of all tabs? Here is my code: background.js browser.browserAction.onClicked.addListener(() => { browser.tabs.query({}).then((tabs) => { tabs.forEach((tab) => { console.log(`Tab ID: ${tab.id}, Title: ${tab.title}, Index: ${tab.index}`); }); }); }); manifest.json { "manifest_version": 2, "name": "Close Tabs ", "version": "1.0", "description": "Clsoe Tabs ", "permissions": ["tabs"], "background": { "scripts": ["background.js"], "persistent": false }, "browser_action": { "default_icon": { "16": "icons/icon-16.png", "48": "icons/icon-48.png", "128": "icons/icon-128.png" }, "default_title": "Close Tabs " } } My pc firefox version is 134.0.1, With firefox nightly for android version 134.0a1

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.