gomita / firegestures

FireGestures, a Firefox extension.
http://www.xuldev.org/firegestures/
Other
128 stars 30 forks source link

Focus Last Tab gesture in Get Script doesn't work #92

Open bottleblue opened 9 years ago

bottleblue commented 9 years ago

In the Get Scripts section (http://www.xuldev.org/firegestures/getscripts.php) the gesture "Focus Last Tab" does not work reliably. Sometimes it will work and sometimes it will close all your tabs except for one.

Also the "Focus Last Selected Tab" gesture doesn't work reliably either. Sometimes it works and sometimes it does nothing.

Can someone update the gestures' codes?

sergwish commented 9 years ago

Here is Focus Last Selected Tab reliable code:

if (ctrlTab) {
  // last active tab
  ctrlTab.open();
  ctrlTab.pick();
} else {
  // tab on the left
  gBrowser.tabContainer.advanceSelectedTab(-1, true);
} 

and Focus Before Last Selected Tab, as a bonus:

if (ctrlTab) {
  // before last active tab
  ctrlTab.open();
  ctrlTab.advanceFocus(true);
  ctrlTab.pick();
} else {
  // second tab on the left
  gBrowser.tabContainer.advanceSelectedTab(-1, true);
  gBrowser.tabContainer.advanceSelectedTab(-1, true);
} 

Please change/add.

bottleblue commented 9 years ago

It doesn't work. It says "gesture failed: (TypeError: this.tablist is null)