Chaos in a Can

Subscribe to RSS feed

Posts tagged with "tabs"

Windows and Tabs API Extensions

, , ,

Barring a few annoying bugs, Opera 12.00's new Windows and Tabs API is a vast improvement over the old one. At first glance however, it seems to be missing features like the ability to move tabs. Fortunately, that functionality is available, it just isn't obviously accessible, which is why I wrote a library of extensions to the API.

Windows and Tabs API Extensions adds the following:
  • Fixes a bug with BrowserTabGroupManager.create which destabilizes Opera (build 1387) if grouped tab is already part of a group. (The fix merely ungroups each tab before creating the new group)
  • Defines a global TabUtils object with useful helper methods
  • Adds nextSibling and previousSibling properties to BrowserTab and BrowserTabGroup objects. These let you get the adjacent tabs/groups in a tab or group's container.
  • Adds nextTab and previousTab properties to BrowserTab objects. These let you get the tabs immediately to the left and right of a given tab.
  • Adds firstTab and lastTab properties to BrowserTabGroup objects. These let you get the leftmost and rightmost tabs in a group.
  • Adds an ungroup() method to BrowserTab objects, which (if possible) removes the tab from its group.
  • Adds an at() method to BrowserTabGroup and BrowserWindow objects, which finds the tab or group at a given position.
  • Adds an insertAfter() method to BrowserTabGroup and BrowserWindow objects, which acts just like insert(), but adds the item after the child item instead of before it.
  • Adds a move() method to BrowserTabGroup and BrowserWindow objects, which moves a tab or group to a given position within the group or window.

You can find the library and more information about it on its Github page.