Finds the index of the selected title from the tab-bar.
the index of the selected title if it is available in the tab-bar, else returns the index of currently-selected title.
registers event listener which make sure that window doesn't get closed if CMD/CTRL W is pressed. Too many users have that in their muscle memory. Chrome doesn't let us rebind or prevent default the keybinding, so this at least doesn't close the window immediately.
Maximize the bottom or the main dockpanel based on the widget.
used to find the selected widget.