balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

Simple tab group intergration. #12

Open vredesbyyrd opened 4 years ago

vredesbyyrd commented 4 years ago

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.

balta2ar commented 4 years ago

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?

Drive4ik commented 4 years ago

Hi guys! Sorry for the long wait for an answer. @vredesbyyrd Yes, you can send external message for STG addon with this actions:

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: