Mouse Gestures - Using my own keyboard shortcut (Javascript)
-
- Posts: 4
- Joined: March 16th, 2007, 10:04 am
Mouse Gestures - Using my own keyboard shortcut (Javascript)
Hi all,
I use Mouse Gestures extension and would very much like to be able to close tabs but in such a way that when the last tab is closed the entire browser closes. The only way I can think of doing this is by mapping a keyboard shortcut in Mouse Gestures to 'ctrl+w'. Only problem is I don't know how to do this using Javascript.
Can anyone help?
Thank you in advance oh internet community you!
martyn
I use Mouse Gestures extension and would very much like to be able to close tabs but in such a way that when the last tab is closed the entire browser closes. The only way I can think of doing this is by mapping a keyboard shortcut in Mouse Gestures to 'ctrl+w'. Only problem is I don't know how to do this using Javascript.
Can anyone help?
Thank you in advance oh internet community you!
martyn
-
- Guest
Try using this Javascript with a gesture:
Code: Select all
if (gBrowser.mTabs.length == 1) {
goQuitApplication();
}
else {
BrowserCloseTabOrWindow();
}
-
- Guest
Sorry, I misread your post. You want a keyboard shortcut to do that. I'm not sure how one would do that with Mouse Gestures.
You can install the userChrome.js extension:
http://forums.mozillazine.org/viewtopic.php?t=397735
Restart Firefox
Add the following to userChrome.js in your profile:
That will allow you to use Ctrl-w to close tabs and then the application if only one tab is open.
You can install the userChrome.js extension:
http://forums.mozillazine.org/viewtopic.php?t=397735
Restart Firefox
Add the following to userChrome.js in your profile:
Code: Select all
(function() {
var cW = document.getElementById('cmd_close');
cW.setAttribute('oncommand', 'if (gBrowser.mTabs.length == 1) { goQuitApplication(); } else { BrowserCloseTabOrWindow();}');
})();
That will allow you to use Ctrl-w to close tabs and then the application if only one tab is open.
-
- Posts: 4
- Joined: March 16th, 2007, 10:04 am
-
- Guest
Open link in new tab, never blank
I use mouse gestures all the time but I'd like to change a setting.
The default behaviour of mgB_OpenBlankOrLinkTab is open link in new tab, if no link is present it will open a new blank tab.
I always end up opening a new blank tab by mistake so I need a custom javascript gesture to just open a link in new tab, without opening a blank tab if no link is present.
Can somebody help me?
The default behaviour of mgB_OpenBlankOrLinkTab is open link in new tab, if no link is present it will open a new blank tab.
I always end up opening a new blank tab by mistake so I need a custom javascript gesture to just open a link in new tab, without opening a blank tab if no link is present.
Can somebody help me?
- chrizoo
- Posts: 374
- Joined: October 11th, 2006, 5:58 pm
-
- Guest
chrizoo wrote:no problem:
<a href="mozgest://addmapping/browser/RU;RUU/custom/!link%3A%20open%20hovered%20in%20tab/if%20(globalOnLink%20%26%26%20globalOnLink.length%20%3E%200)%20%7B%0A%20%20window.getBrowser().addTab(globalOnLink%5B0%5D)%0A%7D%0A/">!link: open hovered in tab (RU)</a>
Hi chrizoo
That was exactly what I was looking for.
Thank you very much!!
-
- Guest