simple-tab-groups icon indicating copy to clipboard operation
simple-tab-groups copied to clipboard

Addon dev help: get length of each group

Open vredesbyyrd opened this issue 4 years ago • 1 comments

Hi,

I am working on a simple addon that interfaces with STG. Does anyone know if it is possible to request from STG the length of each tab group, eg...

group1: #loaded / #total 
group2: #loaded / #total 

Essentially the same info that is displayed in the popover for each group. From flipping through the source I believe the relevant function I want to replicate is groupTabsCountMessage.

The action {"action":"get-groups-list"} returns an array of objects for each group:

{
  "id": 7,
  "title": "group1",
  "isArchive": false,
  "isSticky": false,
  "iconUrl": "data:image/svg+xml,",
  "contextualIdentity": null,
  "windowId": 1
} 
...

Is it possible to retrieve any tab information from get-groups-list?

I have read through the firefox addon doc and I cannot envision how to get per-group data via tabs.query() as it has no concept of "groups", if I am understanding correctly. This is my first time using js/html, complete noob. I am using this mini-project to get familiar with it. If you read this far and have any ideas/hints it would be greatly appreciated.

Thanks for your time, and for the great addon!

vredesbyyrd avatar Jun 19 '21 01:06 vredesbyyrd

You won't have direct access to the tabs and their data, because this contradicts the "permissions" field in manifest.json. Ideally, I could check the correct permissions for the addon that made the request, but I don't see the point in that yet. The number of tabs is just a small option.

Drive4ik avatar Nov 09 '21 21:11 Drive4ik