Jump to content

Mozgest - Close Other Tabs


Recommended Posts

Thought y'all might find this helpful. I use the Googlebar extension in Firefox and it opens a new tab for each search. Eventually, I'll get to where I have several tabs open that I don't need. I wanted to create a new gesture that allowed me to close the other tabs besides the one I as currently viewing. This is how I accomplished it (if you use mozilla instead of mozilla-firefox, it should work the same, only the directory paths would be different):

 

I never use the Open New Document gesture which is Down (D), so I used it.

With no browser open:

 

In /usr/lib/mozilla-firefox-0.8/chrome/mozgest/locale/en-US/mozgest:

In mozgest.properties:

Comment out mgB_OpenNewDocument=Open new document like this:

# mgB_OpenNewDocument=Open new document

 

Add:

mgB_CloseOther=Close other tabs

 

In /usr/lib/mozilla-firefox-0.8/chrome/mozgest/content:

 

In defaultMappings.rdf:

Remove the line that has mgB_OpenNewDocument and add:

<RDF:li><RDF:Description MG:code="D" MG:function="mgB_CloseOther"/></RDF:li>

 

In functions.rdf:

Remove the line that has mgB_OpenNewDocument and add:

<RDF:li><RDF:Description MG:func="mgB_CloseOther"/></RDF:li>

 

In gestimp.js:

Remove the function related to OpenNewDocument and add these two sections:

 

function mgB_CloseOther(){
 BrowserCloseOtherTabs();
 resetRocker();
 return "mgB_CloseOther";
}

 

and

function BrowserCloseOtherTabs(){
 var browser = getBrowser();
 browser.removeAllTabsBut(browser.mCurrentTab);
 return "BrowserCloseOtherTabs";
}

 

Open Firefox. Click Tools -> Options -> Extensions -> Mouse Gestures -> Options -> Edit Mappings -> Browser

 

Check to see if "D Close Other Tabs" is listed under Active Mappings. If it is, you are done. If it's not, then Highlight it under Inactive Mappings and click 'Add'.

Edited by Steve Scrimpshire
Link to comment
Share on other sites

I'm using All-in-One Gestures 0.11.1 and it already has one for "Close all other tabs" ;)

 

 

mind you, if i wanted to use it I'd need to change it's setup since right now it's set to:

right-left-down-up-right

 

which i'll never get right...

Link to comment
Share on other sites

Hmmmm...I had no idea that All-In-One Gestures actually incorporated Mozgest (or that Close Other Tabs was included). Go figure.

I didn't either, until I checked while reading this tip and thinking "that would be great!"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...