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! 🎁

Vyhľadajte odpoveď

Vyhnite sa podvodom s podporou. Nikdy vás nebudeme žiadať, aby ste zavolali alebo poslali SMS na telefónne číslo alebo zdieľali osobné informácie. Nahláste prosím podozrivú aktivitu použitím voľby “Nahlásiť zneužitie”.

Ďalšie informácie

Develop android firefox addon to query all tabs issue

  • Žiadne odpovede
  • 0 má tento problém
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

Ak chcete odpovedať na príspevky, musíte sa prihlásiť do svojho účtu. Ak ešte nemáte účet, položte novú otázku.