keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

hello!

can you tell me please the proper code, so that when the focus/cursor is inside the address bar, double space bar to equal to one space and one enter?

thanks!
reevuur
Posts: 375
Joined: September 13th, 2004, 2:02 pm

Re: keyconfig 20110522

Post by reevuur »

dorando wrote:
reevuur wrote:Every time I change some shortcut, click on APPLY, the new key is visible in the keyconfig window.
When I restart thunderbird the old keys are back again.

I tried also to change the keys in prefs.js with my text-editor (thunderbird is not opened).
Same thing.. I restart thunderbird and the old keys are back again.
Anything in the Error Console (Tools > Web Developer)? Do the entries disappear from prefs.js?


Nothing there.
But...
I tried again to add the same shortcut and now it works fine.
Don't know what went wrong 2 weeks ago.

Tnx. for your help.
troypst
Posts: 16
Joined: March 15th, 2013, 5:19 am

Re: keyconfig 20110522

Post by troypst »

I updated to ff20 and now dev tools shortcuts (ctrl+maiusc+s,i,x) keep resetting themselves every time firefox is restarted. Any solutions? Cause if mozilla idiots manage to break even keyconfig I swear I'm gonna switch to Chrome.
Rounak
Posts: 6
Joined: October 7th, 2009, 5:58 am

Re: keyconfig 20110522

Post by Rounak »

I added

Code: Select all

document.getElementById("dwhelper-statusbar-button").open = true;  
and assigned it a shortcut so that I can open Download helper menu from status bar.
The menu opens correctly and displays the various options of video quality.
The problem:
While a mouse click gets me to the download window, pressing return key merely opens another sub-menu and I have to press down arroy key twice again to get to "Download" menu-item and then press return.

Any ideas to simulate the mouse click with keyboard or any other ideas to make it faster?
Thanks.
rbfye14
Posts: 26
Joined: April 9th, 2012, 8:23 am

Re: keyconfig 20110522

Post by rbfye14 »

How to set delay between two commands in Keyconfig?
rayrayray
Posts: 10
Joined: February 20th, 2012, 2:29 am

Re: keyconfig 20110522

Post by rayrayray »

Anyone got a command to launch a new private window in FF 20?
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

Code: Select all

OpenBrowserWindow({private: true})
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
VLMin
Posts: 67
Joined: April 14th, 2006, 7:15 pm

keyconfig adversely affects logins; tab key causes page relo

Post by VLMin »

I'm using Firefox 20.0.1 on Windows 7 SP 1. However, this problem has existed for the past several Firefox versions.

When I have keyconfig installed, certain shortcuts fail or malfunction. For example, pressing the TAB key causes Firefox to reload the current page overriding the cache. Also, whenever I have a login page or certain other pages that require data input, keyconfig causes Firefox to reload the page over and over and over again, so that I cannot log in!

I have run Firefox with many, many extensions enabled and disabled, and the only one that causes these problems is keyconfig. Has anyone else experienced this? Is there a solution?

Oh ... I've removed and reinstalled keyconfig and changed zero shortcuts at this point. Still, the same problem.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

firefoxuse wrote:can you tell me please the proper code, so that when the focus/cursor is inside the address bar, double space bar to equal to one space and one enter?
Character producing shortcuts are not usable for <key>s if the focus is in a text box,

You could try to build an extension handling that keypress event by opening your Profile and create within the extensions folder a folder named userxul@nobody containing:

install.rdf

Code: Select all

<?xml version="1.0"?>
<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://www.mozilla.org/2004/em-rdf#">

 <rdf:Description rdf:about="urn:mozilla:install-manifest">
  <id>userxul@nobody</id>
  <name>User XUL</name>
  <version>0</version>

  <targetApplication><rdf:Description>
   <id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
   <minVersion>1.0+</minVersion>
   <maxVersion>*</maxVersion>
  </rdf:Description></targetApplication>

 </rdf:Description>
</rdf:RDF>
chrome.manifest

Code: Select all

content userxul .
overlay chrome://browser/content/browser.xul chrome://userxul/content/browser.xul 
browser.xul

Code: Select all

<?xml version="1.0"?>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript"><![CDATA[ window.addEventListener("keypress", function (event){
 var modifiers = ["Alt","Control","Meta","Shift","OS"]
 .filter(event.getModifierState, event).join(" ");

 switch(event.charCode) {
  case KeyEvent.DOM_VK_SPACE:
   if(gURLBar.inputField == document.activeElement && / $/.test(gURLBar.textValue)) {
    gURLBar.handleCommand();
    event.preventDefault();
    event.stopPropagation();
   }
  break;
 }

},true); ]]></script>

</overlay>
(note that the files should not contain any space at the start).

troypst wrote:I updated to ff20 and now dev tools shortcuts (ctrl+maiusc+s,i,x) keep resetting themselves every time firefox is restarted. Any solutions? Cause if mozilla idiots manage to break even keyconfig I swear I'm gonna switch to Chrome.
The devtools shortcuts get added after keyconfig applies the changes. To properly support such <key>s some architectural changes are needed, but for the time being it seems to be possible to initialize the devtools shortcuts sooner by adding

Code: Select all

if(this.gDevToolsBrowserthis.gDevToolsBrowser._addAllToolsToMenu(this.document); 
to keyconfig.global.20110522 in about:config.

Rounak wrote:I added

Code: Select all

document.getElementById("dwhelper-statusbar-button").open = true;  
and assigned it a shortcut so that I can open Download helper menu from status bar.
The menu opens correctly and displays the various options of video quality.
The problem:
While a mouse click gets me to the download window, pressing return key merely opens another sub-menu and I have to press down arroy key twice again to get to "Download" menu-item and then press return.

Any ideas to simulate the mouse click with keyboard or any other ideas to make it faster?
Try

Code: Select all

var button document.getElementById("dwhelper-statusbar-button");
var 
menupopup document.getElementById("dwhelper-statusbar-menupopup");

if(!
button || button.type != "menu-button" || !menupopup) return;

button.open true;

window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils).
sendKeyEvent("keypress"KeyEvent.DOM_VK_DOWN00);

var 
handler = {
 
handleEvent: function(event){
  switch(
event.type) {
   case 
"popuphiding":
    if(
event.eventPhase == event.AT_TARGET) {
     
window.removeEventListener("keypress"thistrue);
     
event.target.removeEventListener("popuphiding"thisfalse);  
    }
    break;
   case 
"keypress":
    if(
event.keyCode == KeyEvent.DOM_VK_RETURN) {
     var 
item menupopup.querySelector("[_moz-menuactive]:not([open])");
     if(
itemitem.click();
    }
  }
 }
}

menupopup.addEventListener("popuphiding"handlerfalse);
window.addEventListener("keypress"handlertrue); 

rbfye14 wrote:How to set delay between two commands in Keyconfig?
Try

Code: Select all

alert(1);
alert(2);

window.setTimeout(function() {
 
alert(3);
}, 
1000); 

VibrantLife wrote:For example, pressing the TAB key causes Firefox to reload the current page overriding the cache.
Do you have the Tab key assigned to one of the Reload <key>s listed in the keyconfig screen (or any other <key>)?
Support mozilla.dorando.at through donations/contributions.
Rounak
Posts: 6
Joined: October 7th, 2009, 5:58 am

Re: keyconfig 20110522

Post by Rounak »

thank you very much, dorando for making my life easier!!
rbfye14
Posts: 26
Joined: April 9th, 2012, 8:23 am

Re: keyconfig 20110522

Post by rbfye14 »

dorando wrote:Try

Code: Select all

alert(1);
alert(2);

window.setTimeout(function() {
 alert(3);
},
 1000); 

Thanks, dorando!
troypst
Posts: 16
Joined: March 15th, 2013, 5:19 am

Re: keyconfig 20110522

Post by troypst »

dorando wrote:
troypst wrote:I updated to ff20 and now dev tools shortcuts (ctrl+maiusc+s,i,x) keep resetting themselves every time firefox is restarted. Any solutions? Cause if mozilla idiots manage to break even keyconfig I swear I'm gonna switch to Chrome.
The devtools shortcuts get added after keyconfig applies the changes. To properly support such <key>s some architectural changes are needed, but for the time being it seems to be possible to initialize the devtools shortcuts sooner by adding

Code: Select all

if(this.gDevToolsBrowser) this.gDevToolsBrowser._addAllToolsToMenu(this.document); 
to keyconfig.global.20110522 in about:config.



Perfect! I reinstalled ff20 just to try this and now when I disable them they STAY disabled!

Thanx very much.
chirpy_7
Posts: 165
Joined: March 19th, 2007, 6:24 am

Re: keyconfig 20110522

Post by chirpy_7 »

Hi dorando & co,

A couple of hours ago (at most a few days ago) I noticed a change on GOOGLE: the following (for opening individual GOOGLE search results in a new (and/or the current) tab) doesn't seem to work anymore, the "nodes" must have changed slightly:

Code: Select all

if(window.content.location.href.match(/^http(s)?:\/\/www\.google.(com|fr)\/search/))
{
var nodes = content.document.evaluate('//h3/a[@class]', content.document, null, 7, null);
gBrowser.addTab(nodes.snapshotItem(0));
}


The (10 standard) links (in GOOGLE) seem to have this

Code: Select all

<h3 class="r" style="display: inline;">
around them, but simply (naively) replacing "a" with "r" (in the keyconfig code above) didn't do the trick...

Any pointers how to fix the code?

--- Edit ---

Strange... if the google results contain Results for similar searches, then the (old) code (above) (still) works for those ("similar") results... ((but not for the "actual" results...))

... possibly because (unlike with the "normal" results) these links contain a "class" within the anchor tag:

Code: Select all

<a class="l" href=


related stuff, for reference: http://stackoverflow.com/questions/3356 ... te-working and https://developer.mozilla.org/en-US/doc ... t.evaluate and http://commons.oreilly.com/wiki/index.p ... ng_Started (though I don't (and'd prefer not to) use Greasemonkey)
anemholi
Posts: 3
Joined: December 20th, 2012, 5:29 pm

Re: keyconfig 20110522

Post by anemholi »

This code allows keyconfig to toggle thunderbird's thread pane:

if(document.getElementById("threadpane-splitter").collapsed)
mailTabType._setPaneStates({folder:true, thread:true, message:true},{folder:false, message:true});
else
mailTabType._setPaneStates({folder:true, thread:false, message:true},{folder:false, message:true});
Amsuke
Posts: 60
Joined: April 3rd, 2010, 8:23 am

Re: keyconfig 20110522

Post by Amsuke »

For a while now, I've been using the following code which you (Dorando) provided for the up and down arrows to go more than one line.


Arrow Down:

Code: Select all

if(commandDispatcher.focusedWindow.document.designMode == "on")
 goDoCommand("cmd_lineNext");

var target = commandDispatcher.focusedElement;
if(!(target instanceof HTMLInputElement && (target.type == "text" || target.type == "password")))
 commandDispatcher.focusedWindow.scrollByLines(4);



Arrow Up:

Code: Select all

if(commandDispatcher.focusedWindow.document.designMode == "on")
 goDoCommand("cmd_lineNext");

var target = commandDispatcher.focusedElement;
if(!(target instanceof HTMLInputElement && (target.type == "text" || target.type == "password")))
 commandDispatcher.focusedWindow.scrollByLines(-4);



The problem is that certain webmail interfaces are having problems with this - whereby the up arrow key acts like the down arrow key. I don't know how much of this is their fault for non-standard coding, or if it's just the first genuine incompatibility I've run into for this code.

Any idea how to fix this? If you need me to provide you with a test account so you can see it for yourself, let me know, and I'll PM you the details.
Post Reply