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 ta… (ďalšie informácie)
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