Simple tab group intergration.
Hi,
This is probably outside the scope of brotab, but figured I would ask. I use the Simple Tab Groups addon to organize tabs into distinct groups. Basically, instead using multiple window instances of firefox to manage "groups" of tabs, STG allows you to group tabs in a single instance of firefox,
Brotab assigns tabs a window_id that declares which window each tab belongs to. If you only use a single browser window the window_id does not serve a visual purpose. With STG, you can give groups names, eg browsing, research, programming etc. I wonder if it is possible to retrieve these group names from STG to be used with brotab?
My end goal is to retrieve which "stg group" the tabs belong to, and incorporate that information into a Brotab rofi gui. So something like: "<stg_group><prefix>.<window_id>.<tab_id><Tab>Page title<Tab>URL"
I am not that familiar with firefox addons api's, so I am unsure if this would even be possible. If you have any thoughts on this idea I would love to hear them.
Cheers.
Disclaimer: I'm not a frontend developer, what I say may not make any sense :)
The good news is that according to this (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessageExternal) and this (https://developer.chrome.com/extensions/messaging#external) it should be possible. However, AFAIU, the target extension should provide an API and expect such calls. I'm not sure how that data is stored, though I saw such words as "browser.storage" in the extension's code, I still think having an API is much better than one extension author reverse-engineering data of another extension. Thus, I think the best way to go is to ask @Drive4ik directly. Could you please shed some light here, preferably in layman terms for non-frontend developers?
Hi guys! Sorry for the long wait for an answer. @vredesbyyrd Yes, you can send external message for STG addon with this actions:
- {"action":"add-new-group"}
- {"action":"load-next-group"}
- {"action":"load-prev-group"}
- {"action":"load-next-unloaded-group"}
- {"action":"load-prev-unloaded-group"}
- {"action":"load-history-next-group"}
- {"action":"load-history-prev-group"}
- {"action":"load-first-group"}
- {"action":"load-last-group"}
- {"action":"load-custom-group"}
open popup with groups list - {"action":"load-custom-group", "groupId": 5}
open group without popup - {"action":"delete-current-group"}
- {"action":"open-manage-groups"}
- {"action":"move-active-tab-to-custom-group"}
- {"action":"discard-group"}
- {"action":"discard-other-groups"}
- {"action":"reload-all-tabs-in-current-group"}
But to use it, I have to add your addon to the white list with the options necessary for your addon. STG is also able to send a message to your addon. Such as:
- {"action":"i-am-back"}
when addon started, initialized and loaded successfully - {"action":"group-added", "group": {group data}}
- {"action":"group-updated", "group": {new group data}}
- {"action":"group-removed", "groupId": 5}