Next \ Previous \ Close Current tab

3 replies [Last post]
Joined: 07/03/2009
Posts: 2
User offline. Last seen 1 year 6 weeks ago.

Several years ago I had 3 buttons. One for Next tab, Previous tab and one to close the current tab. The site is now gone. Can someone help me with creating these for me.

Thank you very much.

Custom Buttons² v.3.0.1

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)

Posted with the theme Pluralism

Top
morat's picture
Joined: 01/31/2009
Posts: 182
User is online

Welcome to the forum, Ftboomer.

* moves one tab to the right (next tab)

javascript: Copy To Clipboard
/*Code*/
gBrowser.mTabContainer.advanceSelectedTab(1, true);

* moves one tab to the left (previous tab)

javascript: Copy To Clipboard
/*Code*/
gBrowser.mTabContainer.advanceSelectedTab(-1, true);

* removes current tab or nothing if it is the only tab

javascript: Copy To Clipboard
/*Code*/
gBrowser.removeCurrentTab();

* removes all tabs but current tab

javascript: Copy To Clipboard
/*Code*/
gBrowser.removeAllTabsBut(gBrowser.selectedTab);

reference:

https://developer.mozilla.org/en/XUL/tabbrowser
https://developer.mozilla.org/en/Code_snippets/Tabbed_browser

Custom Buttons² v.3.0.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11

Posted with the theme Pluralism

Top
Joined: 07/03/2009
Posts: 2
User offline. Last seen 1 year 6 weeks ago.

Thank you so much. Now if you could just point me to a tutorial of how to apply these.

*EDIT, I think I found it Thanks again

OK, so I got them set up but when I click any of the buttons, I get a pop-up the states "Left Click"

That's it.

I created the buttons by right-clicking the bar and selecting "Add New Button". In the box that pops-up, I pasted your code under the Code section. added a name and selected a picture for the button and clicked OK.

Next went to view, toolbars, customize and added the button to a toolbar.

What could have gone wrong?

Custom Buttons² v.3.0.1

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)

Posted with the theme Pluralism

Top
squeaky's picture
Joined: 03/01/2008
Posts: 191
User offline. Last seen 1 year 3 weeks ago.

Hi,

What you are seeing is the built in mouse handling code.

It's all in the "Initialise" tab and sits between some large comment blocks. If you are only making simple left click buttons - just delete all of the code between the comment blocks. You'll see what I mean when you take a look.

You'll need to SHIFT-LEFT-click to get to the edit menu.

HTH

In fact... once you get there you'll see that it would be a simple job to make a single button for your needs...

  1. Previous Tab in the left-click
  2. Next Tab in right-click
  3. Close Current Tab on middle-click (?)

Leave the shift left click for the menu and delete all the other options.

Innit? Smile

Computers ONLY do what you TOLD them to do - which is NOT necessarily what you THINK you told them to do!

Custom Buttons² v.3.0.1

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)

Posted with the theme Pluralism

Top