Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

Develop android firefox addon to query all tabs issue

  • Nema odgovora
  • 0 ima ovaj problem
  • 1 prikaz
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.