breach_core icon indicating copy to clipboard operation
breach_core copied to clipboard

Get the current foreground tab

Open nearsyh opened this issue 11 years ago • 10 comments

Is it possible to get the current foreground tab id?

nearsyh avatar Jul 29 '14 21:07 nearsyh

Seems impossible with the apI of the current version.

nearsyh avatar Jul 29 '14 22:07 nearsyh

Line 131 of https://github.com/breach/breach_core/blob/master/lib/core_tabs.js Also I think the tabs_state has this information (shrug)

kyleshrader avatar Jul 29 '14 22:07 kyleshrader

You can use tabs_get and look for the visible key for each tab

spolu avatar Jul 29 '14 22:07 spolu

@kylekinkade the visibile_tab is private which I think is not good to use.

nearsyh avatar Jul 29 '14 23:07 nearsyh

@nearsyh @kylekinkade it's definitely not accessible from other moduiles... that's why you want tabs_get from modules

spolu avatar Jul 29 '14 23:07 spolu

@spolu Thanks! But maybe adding an api for this is a good idea.

nearsyh avatar Jul 29 '14 23:07 nearsyh

@nearsyh You mean have direct access to the visible tab?

spolu avatar Jul 29 '14 23:07 spolu

Yes.

nearsyh avatar Jul 29 '14 23:07 nearsyh

@spolu If you would like I can make a PR for a tabs_current method that traverses the array provided by tabs_get and returns the current tab? Unless you have other plans.

brayniverse avatar Jul 30 '14 08:07 brayniverse

Sure that could be useful!

spolu avatar Jul 30 '14 21:07 spolu