keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110323

Post by dorando »

bolidew wrote:
dorando wrote:
bolidew wrote:I used this command to "Hide/Show TabBar":
"gBrowser.mStrip.collapsed = !gBrowser.mStrip.collapsed;"

But it doesn't work any more in Firefox 4 (with "Tabs on Top" disabled).

Would appreciate any suggestions for a shortcut key to Hide/Show TabBar ! Thanks.
Try

Code: Select all

gBrowser.tabContainer.parentNode.collapsed = !gBrowser.tabContainer.parentNode.collapsed
I am using TreeStyleTab and this works on Top/Bottom tabbar position however if the tabbar is on Left/Right, it only toggles the visibility of tabs but not the BAR (placeholder). Any advice?
Thanks a lot.
Try

Code: Select all

gBrowser.tabContainer.parentNode.collapsed = !gBrowser.tabContainer.parentNode.collapsed;
gBrowser.treeStyleTab.splitter.hidden = !gBrowser.treeStyleTab.splitter.hidden;
gBrowser.treeStyleTab.splitter.previousSibling.hidden = !gBrowser.treeStyleTab.splitter.previousSibling.hidden

ekbworldwide wrote:
nightson wrote:I used MenuManipulator to get the correct code from "Restore Previous Session" in history menu :D

Does MenuManipulator work like this(?)

  1. You select an element from a menu.
  2. The keyconfig(-like) code it uses can be copy and pasted.

Is that right?

Also - does it work inside the context-menu too?
For those with an oncommand you can get it with MenuManipulator, but you could also use the following with keyconfig (before clicking on a menu item)

Code: Select all

function getCommand(event) {
 
window.removeEventListener("command"arguments.calleetrue);
 
event.preventDefault();
 
event.stopPropagation();

 
alert(event.target.getAttribute("oncommand") || event.target.getAttribute("onclick"));
}

window.addEventListener("command"getCommandtrue); 

Cattleya wrote:Now, can you help me a hotkey to Flush DNS Cache like these addons:
https://addons.mozilla.org/vi/firefox/addon/dns-cache/
https://addons.mozilla.org/vi/firefox/a ... s-flusher/
Try

Code: Select all

var networkIoService Components.classes["@mozilla.org/network/io-service;1"]
.
getService(Components.interfaces.nsIIOService);
networkIoService.offline true;
var 
cacheService Components.classes["@mozilla.org/network/cache-service;1"]
.
getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE);
networkIoService.offline false

Noi wrote:[…] on Firefox 4.0 it is not possible to see the menu of "MenuManipulator", because no menu item is available (why not?), and i don't know other way to run this extension.
The menu item is still listed in the Tools menu in the Menu Bar (unhide it by pressing Alt or through Firefox Button > Options > Menu Bar).
Noi wrote:How to set a Hotkey in Keyconfig to run "MenuManipulator”?
Try

Code: Select all

openDialog('chrome://menumanipulator/content/main.xul''_blank''resizable'window); 

ballyhairs wrote:That didn't work for me, the only thing it does is to minimize when active, further nothing :?
Anything in the Error Console?
Did you set the key to global? (Note that you need to disable/enable the linked extension after setting a key to global).
Support mozilla.dorando.at through donations/contributions.
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20110323

Post by ballyhairs »

Hello dorando,
I followed your instructions, nothing happens, it only minimizes it when active, and there is the following message in the error console on Firefox startup

Code: Select all

Warning: WARN addons.xpi: Exception running bootstrap method startup on keyconfig-global@dorando: TypeError: expected type unsigned_int, got (void 0)
Source File: resource://gre/modules/XPIProvider.jsm -> jar:file:///D:/Program%20Files/Portable/Firefox/Data/profile/extensions/keyconfig-global@dorando.xpi!/bootstrap.js
Line: 41
Cattleya
Posts: 57
Joined: October 7th, 2010, 11:14 pm

Re: keyconfig 20110323

Post by Cattleya »

Try

Code: Select all
var networkIoService = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
networkIoService.offline = true;
var cacheService = Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService);
cacheService.evictEntries(Components.interfaces.nsICache.STORE_ANYWHERE);
networkIoService.offline = false;


Thank you so much, work perfect!

Have a nice day~
Noi
Posts: 2
Joined: April 26th, 2011, 4:48 am

Re: keyconfig 20110323

Post by Noi »

hi dorando,

I have also tested this version before I asked you.
openDialog('chrome://menumanipulator/content/main.xul', '_blank', 'resizable', window);

but it is not possible to.

The menu item is still listed in the Tools menu in the Menu Bar (unhide it by pressing Alt or through Firefox Button > Options > Menu Bar).

I know. But i wont to use the new variant of Firefox, without the Menu Bar (because it is more place). Why they are no settings for MenuManipulator regular in Add-Ons? It is possible and how can i put a Menu-Item from a Add-On in the now Firefox-Menu, without to switch every time to the old Menu Bar?
Alan Baxter
Posts: 4419
Joined: May 30th, 2005, 2:01 pm
Location: Colorado, USA

Re: keyconfig 20110323

Post by Alan Baxter »

What command should I bind to a key to open about:config?
Cattleya
Posts: 57
Joined: October 7th, 2010, 11:14 pm

Re: keyconfig 20110323

Post by Cattleya »

Alan Baxter wrote:What command should I bind to a key to open about:config?

Try:
To open in the current tab:

Code: Select all

gBrowser.loadURI("about:config")


To open in new tab:

Code: Select all

gBrowser.addTab("about:config")
Alan Baxter
Posts: 4419
Joined: May 30th, 2005, 2:01 pm
Location: Colorado, USA

Re: keyconfig 20110323

Post by Alan Baxter »

Thanks, Cattleya. Works great.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110323

Post by dorando »

ballyhairs wrote:Hello dorando,
I followed your instructions, nothing happens, it only minimizes it when active, and there is the following message in the error console on Firefox startup

Code: Select all

Warning: WARN addons.xpi: Exception running bootstrap method startup on keyconfig-global@dorando: TypeError: expected type unsigned_int, got (void 0)
Source File: resource://gre/modules/XPIProvider.jsm -> jar:file:///D:/Program%20Files/Portable/Firefox/Data/profile/extensions/keyconfig-global@dorando.xpi!/bootstrap.js
Line: 41
Try again with version 20110428 which fixes an issue causing it to stop registering shortcuts if any disabled global shortcuts exist, and hopefully improves the error reporting.

Noi wrote:I have also tested this version before I asked you.
openDialog('chrome://menumanipulator/content/main.xul', '_blank', 'resizable', window);
but it is not possible to.
Works for me, anything in the Error Console?
Noi wrote:
The menu item is still listed in the Tools menu in the Menu Bar (unhide it by pressing Alt or through Firefox Button > Options > Menu Bar).
I know. But i wont to use the new variant of Firefox, without the Menu Bar (because it is more place).
Pressing Alt only unhides temporarily…
Noi wrote:Why they are no settings for MenuManipulator regular in Add-Ons?
Adding the MenuManipulator window as a Options dialog likely requires some changes to the code to work as supposed, something I had no time to investigate, and is low priority since it can still be easily accessed by using Alt + the appropriates accesskeys.
Noi wrote:It is possible and how can i put a Menu-Item from a Add-On in the now Firefox-Menu, without to switch every time to the old Menu Bar?
MenuManipulator can't currently edit the Firefox Button since it is not a proper menu, you can use Personal Menu (Personal Firefox Button) to edit it.
Support mozilla.dorando.at through donations/contributions.
morat
Posts: 6437
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110323

Post by morat »

Does anyone know how to list all cmd_ commands in Firefox and Thunderbird?

The following code copies most commands to clipboard.

Code: Select all

var tag = new Array();
tag.push("command");
tag.push("broadcaster");
tag.push("key");
tag.push("menuitem");
var collection = new Object();
for (var i = 0; i < tag.length; i++) {
  collection[tag[i]] = document.getElementsByTagName(tag[i]);
}
var out = new Array();
var info = Components.classes["@mozilla.org/xre/app-info;1"].
  getService(Components.interfaces.nsIXULAppInfo);
var type = document.documentElement.getAttribute("windowtype");
out.push(info.name + " " + info.version, "", type);
for (var i in collection) {
  out.push("", "^ " + i, "");
  for (var j = 0; j < collection[i].length; j++) {
    var id = collection[i][j].getAttribute("id");
    var oncommand = collection[i][j].getAttribute("oncommand");
    if (id && oncommand) out.push(id);
  }
}
var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"].
  getService(Components.interfaces.nsIClipboardHelper);
if (navigator.platform.indexOf("Win")) {
  clipboard.copyString(out.join("\n"));
} else {
  clipboard.copyString(out.join("\r\n"));
}
alert("done");

There are some commands absent like cmd_scrollTop from platformHTMLBindings.xml.

view-source:chrome://global/content/platformHTMLBindings.xml

Is it possible to list these commands as well?

I found these lists which are helpful, but not exhaustive.

https://developer.mozilla.org/en/XUL/List_of_commands
http://www.mozilla.org/unix/customizing.html
http://kb.mozillazine.org/Keyconfig_extension:_Firefox
http://kb.mozillazine.org/Keyconfig_ext ... hunderbird

If anyone does not already know... here is how to execute a command.

Code: Select all

var cmd = "cmd_paste"; // command is implemented by a controller
// var cmd = "cmd_close";
var controller = document.commandDispatcher.getControllerForCommand(cmd);
if (controller) {
  if (controller.isCommandEnabled(cmd)) {
    controller.doCommand(cmd);
  }
} else {
  var element = document.getElementById(cmd);
  if (element) {
    element.doCommand();
  }
}

Code: Select all

// succeeds since command is implemented by a controller
goDoCommand("cmd_paste");

Code: Select all

// fails
goDoCommand("cmd_close");

Code: Select all

// succeeds
document.getElementById("cmd_close").doCommand();

I think the Keyconfig Thunderbird page should mention the doCommand function.
Last edited by morat on May 9th, 2011, 12:59 pm, edited 2 times in total.
emil9216
Posts: 13
Joined: September 23rd, 2008, 2:26 am

Re: keyconfig 20110323

Post by emil9216 »

Is it possible to change the default key combination for switching tabs "ctrl+tab" with this combination "alt+~" ?


Thanks!
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110323

Post by chirpy_7 »

hi dorando & co,

just noted a minor behavioural change:

hitting s would hitherto toggle star / unstar (bookmark) the current tab:

Code: Select all

if(PlacesStarButton._starred) {
 StarUI._itemId = PlacesUtils.getMostRecentBookmarkForURI(gBrowser.currentURI);
 StarUI.removeBookmarkButtonCommand();
} else {
 PlacesCommandHook.bookmarkCurrentPage(false);
}


Now, unfortunately, the unstar bit does not work anymore.


Help much appreciated , no rush at all; enjoy your weekend !!!

chirpy
Hamid_Y2K
Posts: 20
Joined: July 8th, 2010, 4:59 am

Re: keyconfig 20110323

Post by Hamid_Y2K »

hi
i need code below Items for FF4
"CopyCurrentURI"
"OpenCookieInfo"
i use "colt" ext i want code
"Copy link text"
"copy link location"
And
"Organize Statusbar""

Thanks
kpts44
Posts: 1
Joined: May 2nd, 2011, 1:03 pm

Re: keyconfig 20110323

Post by kpts44 »

I was looking for a piece of code to toggle showing only starred messages in thunderbird using keyconfig, but was unable to find it. So I digged into thunderbird's source code and here is something that seems to do the trick (which I mapped to shift+S). Maybe it can help someone else!

Code: Select all

QuickFilterBarMuxer._showFilterBar(true);
// these 2 lines are optional, but I prefer to always make filters sticky
document.getElementById("qfb-sticky").checked = true;
QuickFilterBarMuxer.activeFilterer.setFilterValue("sticky", true);

var domNode = document.getElementById("qfb-starred");
domNode.checked = !domNode.checked;
if (domNode.checked) {
  QuickFilterBarMuxer.activeFilterer.setFilterValue("starred", true);
} else {
  QuickFilterBarMuxer.activeFilterer.setFilterValue("starred", null);
}
QuickFilterBarMuxer.deferredUpdateSearch();
Last edited by kpts44 on May 3rd, 2011, 4:55 pm, edited 1 time in total.
OzarksCrescentMural
Posts: 20
Joined: July 23rd, 2010, 5:18 pm

Re: keyconfig 20110323

Post by OzarksCrescentMural »

I recently got a new computer and I'm now using Firefox 4.0.1. I was using keyconfig before and I'd like to get it back.

Where can I download a copy of keyconfig that will work in Windows for Firefox 4.0.1?

Where can I find a list of the Codes too?

Thanks for your help!
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20110323

Post by ballyhairs »

Thanks dorando, you always save me :)
Post Reply