keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
User avatar
digideth
Posts: 54
Joined: May 31st, 2008, 8:48 pm

Re: keyconfig 20110522

Post by digideth »

Zoolcar9 wrote:
digideth wrote:OK so I went and added a New Key for Print Preview using this code:

Code: Select all

PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview);

Nothing happens when i try the shortcut key that i set for it which is Ctrl+Shft+P (i disabled the original item for that shortcut, start private browsing).

Try

Code: Select all

PrintUtils.printPreview(PrintPreviewListener); 


You made my day Zoolcar9!

Thank You Thank You Thank You

=D>
tnonce
Posts: 7
Joined: June 14th, 2011, 12:45 pm

Re: keyconfig 20110522

Post by tnonce »

Is anyone else experiencing any problems with keyconfig and Firefox 19 on Linux? All of my shortcuts have stopped working, and I can't figure out why. There's no trace in Error Console. keyconfig still has all the original definitions. All the code is still there. I have Ctrl+Shift+~ mapped to opening a new tab with about:config, and Ctrl+Alt+R mapped to a browser restart. Neither works.

Here's the code:

Code: Select all

Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser").openUILinkIn("chrome://global/content/config.xul", "tab");

and

Code: Select all

// Notify all windows that an application quit has been requested.
var os = Components.classes["@mozilla.org/observer-service;1"]
 .getService(Components.interfaces.nsIObserverService);
var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]
 .createInstance(Components.interfaces.nsISupportsPRBool);

os.notifyObservers(cancelQuit, "quit-application-requested", "restart");

// Something aborted the quit process.
if (cancelQuit.data)
 return;

var nsIAppStartup = Components.interfaces.nsIAppStartup;
Components.classes["@mozilla.org/toolkit/app-startup;1"].getService(nsIAppStartup)
 .quit(nsIAppStartup.eRestart | nsIAppStartup.eAttemptQuit);
User avatar
onemen
Posts: 1136
Joined: October 15th, 2004, 7:48 am

Re: keyconfig 20110522

Post by onemen »

Hello dorando,

keyConfig code add ids to some keys that Firefox add without id
The id is in a format of id="xxx_key29_Browser:Reload" (the number is the index number in mainKeyset)
then changes to that key are saved in the preference keyconfig.main.xxx_key29_Browser:Reload

what will happen if Firefox (or extension) will change the order in mainKeyset, or add new keys in the start of the list.
Then the preference will not match the new id
abcuser
Posts: 261
Joined: March 12th, 2007, 11:19 pm

Re: keyconfig 20110522

Post by abcuser »

Firefox 10 ESR on Windows. How to add shortcut for removing all saved passwords:
Tools | Options | Security | Saved Passwords button | Remove All
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

abcuser wrote:How to add shortcut for removing all saved passwords

With confirmation:

Code: Select all

var confrm = Services.prompt.confirmEx(null, "Remove all passwords",
                                       "Are you sure you wish to remove all passwords?",
                                       16778243, null, null, null, null, { value: false });
if (confrm == 0) Services.logins.removeAllLogins(); 

Without confirmation:

Code: Select all

Services.logins.removeAllLogins();
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
abcuser
Posts: 261
Joined: March 12th, 2007, 11:19 pm

Re: keyconfig 20110522

Post by abcuser »

Zoolcar9 wrote:

Code: Select all

Services.logins.removeAllLogins();

This is exactly what I need. Thanks a lot.
titlebar02
Posts: 77
Joined: August 29th, 2012, 5:24 pm

Re: keyconfig 20110522

Post by titlebar02 »

I'm using

- Vista
- Keyconfig 20110522
- Firefox 18.0.2

I've been using Keyconfig for years without problems but a few minutes ago I upgraded to 18.0.2 and now all of the keyboard shortcuts are broken.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

tnonce wrote:Is anyone else experiencing any problems with keyconfig and Firefox 19 on Linux? All of my shortcuts have stopped working, and I can't figure out why. There's no trace in Error Console. keyconfig still has all the original definitions. All the code is still there. I have Ctrl+Shift+~ mapped to opening a new tab with about:config, and Ctrl+Alt+R mapped to a browser restart. Neither works.
Seems to work for me on Slacko 5.3.3 with 19.0b4. Does changing/disabling other shortcuts work?

onemen wrote:Hello dorando,

keyConfig code add ids to some keys that Firefox add without id
The id is in a format of id="xxx_key29_Browser:Reload" (the number is the index number in mainKeyset)
then changes to that key are saved in the preference keyconfig.main.xxx_key29_Browser:Reload

what will happen if Firefox (or extension) will change the order in mainKeyset, or add new keys in the start of the list.
Then the preference will not match the new id
The code responsible for that will likely be replaced by the code I posted for K4RBQT99.

titlebar02 wrote:I've been using Keyconfig for years without problems but a few minutes ago I upgraded to 18.0.2 and now all of the keyboard shortcuts are broken.
Anything in the Error Console (Tools > Web Developer)?
Support mozilla.dorando.at through donations/contributions.
titlebar02
Posts: 77
Joined: August 29th, 2012, 5:24 pm

Re: keyconfig 20110522

Post by titlebar02 »

dorando wrote:
titlebar02 wrote:I've been using Keyconfig for years without problems but a few minutes ago I upgraded to 18.0.2 and now all of the keyboard shortcuts are broken.
Anything in the Error Console (Tools > Web Developer)?

I went to make a test for the Error Console and now everything is working again.
titlebar02
Posts: 77
Joined: August 29th, 2012, 5:24 pm

Re: keyconfig 20110522

Post by titlebar02 »

What's the code for restart?

I used to use this...

Code: Select all

local_common.restartPrompt(nsPreferences.getBoolPref('local_install.promptToRestart'));

...but it doesn't work anymore.
kit kat
Posts: 16
Joined: May 26th, 2010, 6:25 pm

Re: keyconfig 20110522

Post by kit kat »

Thanks, this has been solved already
/has too many questions.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

titlebar02 wrote:What's the code for restart?

With confirmation

Code: Select all

var confrm = Services.prompt.confirmEx(null, "Restart " + Application.name,
                                       "Are you sure you want to restart " + Application.name + "?",
                                       16778243, null, null, null, null, { value: false });
if (confrm == 0) Application.restart(); 

Without confirmation

Code: Select all

Application.restart(); 
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
firefoxuse
Posts: 1086
Joined: November 8th, 2011, 12:06 pm

Re: keyconfig 20110522

Post by firefoxuse »

is there a code to "close duplicate tabs" ???

thanks!
morat
Posts: 6421
Joined: February 3rd, 2009, 6:29 pm

Re: keyconfig 20110522

Post by morat »

@firefoxuse

Try this:

Code: Select all

// remove all duplicate tabs
a:for (var i = 0; i < gBrowser.tabContainer.childNodes.length; i++) {
  for (var j = 0; j < gBrowser.tabContainer.childNodes.length; j++) {
    var m = gBrowser.tabContainer.childNodes[i].linkedBrowser.currentURI.spec;
    var n = gBrowser.tabContainer.childNodes[j].linkedBrowser.currentURI.spec;
    if (i != j && j != gBrowser.tabContainer.selectedIndex && m == n) {
      gBrowser.removeTab(gBrowser.tabContainer.childNodes[j]);
      i = i - 1; continue a;
    }
  }
}
Hamid_Y2K
Posts: 20
Joined: July 8th, 2010, 4:59 am

Re: keyconfig 20110522

Post by Hamid_Y2K »

Hi :)
colt addon
please code for tab context menu copy URI > Simple URI and Page Title and URI

thanks
Post Reply