keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
nigelle
Posts: 117
Joined: June 9th, 2005, 8:30 am
Location: France

Re: keyconfig 20110522

Post by nigelle »

To Dorando
Short-cut conflict :
Only the keyconfig Window does detect it, not keyconfig-service. For a shortcut try


I have created a conflict on purpose and your proposed short-cut as alt+ctrl+shift+F12 : Thanks it works, it signals a conflict and do nothing (maybe a "no-conflict" message should be better) when I dis-activate the conflicting short-cut. Can you include this in the next standard version ?
It'll protect us against the creation of bad new short-cuts by Mozilla...

Small problem : how to delete the erroneous short-cut ?
NarkTwo
Posts: 2
Joined: December 18th, 2012, 11:45 pm

Re: keyconfig 20110522

Post by NarkTwo »

NarkTwo wrote:So I am trying to figure out what the script is to enable and disable single window mode in Tab Mix Plus

Code: Select all

var prefname = "extensions.tabmix.singleWindow";
var singleWindowMode = Services.prefs.getBoolPref(prefname)
Services.prefs.setBoolPref(prefname, !singleWindowMode);
var as = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
as.
showAlertNotification("chrome://tabmixplus/skin/tmp.png",
                         "Single Window Mode",
                         singleWindowMode ? "DISABLED" : "ENABLED",
                         false, "", null); 



Thank you so much for this... I knew someone here could figure this out... I tried to search through other various codes to try and figure it out, but now that I see what the ending code was, I never would have been able to..

Thanks so much Zoolcar9, you are the master.

I appreciate it!

NarkTwo
thuldai
Posts: 10
Joined: June 2nd, 2004, 8:03 am
Location: NYC

Re: keyconfig 20110522

Post by thuldai »

I'd love to change the language of the spell checker using a keyboard shortcut. I found the hint that I could set a shortcut using

Code: Select all

changeLanguage({ target: "en-US", __noSuchMethod__: function() { } });

but it doesn't seem to work. Can anybody here fix this, provide something completely different that works, or confirm that this is currently not possible?

Thanks so much for any help.
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

thuldai wrote:I'd love to change the language of the spell checker using a keyboard shortcut. I found the hint that I could set a shortcut using

Code: Select all

changeLanguage({ target: "en-US", __noSuchMethod__: function() { } });

but it doesn't seem to work. Can anybody here fix this, provide something completely different that works, or confirm that this is currently not possible?

Code: Select all

Services.prefs.setCharPref("spellchecker.dictionary", "en-US"); 
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
thuldai
Posts: 10
Joined: June 2nd, 2004, 8:03 am
Location: NYC

Re: keyconfig 20110522

Post by thuldai »

Thanks Zoolcar9, it seems to do something. The language label in the bottom right corner of the composer window (that I get from Dictionary Switcher 1.3.2) indeed changes to the language I had set the shortcut to.

BUT it doesn't actually change the spell checking language. The English text in the email is still underlined in red while the other language text (German in my case) stays "white". Adding new text also still gets treated als German.

The tick mark next to languages in the pull-down menu stays in the same place and does not change with pressing the shortcut key.

Any ideas?
abcuser
Posts: 261
Joined: March 12th, 2007, 11:19 pm

Re: keyconfig 20110522

Post by abcuser »

Hi,
on Firefox 10 ESR on Windows I would like to "remove all of the cookies" with keyboard shortcut, so execute the following:
a) Tools | Options
b) Privacy tab
c) Use custom settings for history
d) Show Cookies
e) Remove All Cookies button

I have search the code with DOM Inspector and find a command:
gCookiesWindow.deleteAllCookies();
and I tried to add this command in Keyconfig and nothing happens.

What is appropriate command to delete cookies using Keyconfig?
Thanks
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

thuldai wrote:The language label in the bottom right corner of the composer window (that I get from Dictionary Switcher 1.3.2) indeed changes to the language I had set the shortcut to.

BUT it doesn't actually change the spell checking language. The English text in the email is still underlined in red while the other language text (German in my case) stays "white". Adding new text also still gets treated als German.

The tick mark next to languages in the pull-down menu stays in the same place and does not change with pressing the shortcut key.

Any ideas?

You're right. Sorry, I have no ideas.

abcuser wrote:on Firefox 10 ESR on Windows I would like to "remove all of the cookies" with keyboard shortcut,
<snip>
What is appropriate command to delete cookies using Keyconfig?

Code: Select all

Services.cookies.removeAll() 
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:
abcuser wrote:on Firefox 10 ESR on Windows I would like to "remove all of the cookies" with keyboard shortcut,
<snip>
What is appropriate command to delete cookies using Keyconfig?

Code: Select all

Services.cookies.removeAll() 

This is exactly what I need. Thanks a lot.
abcuser
Posts: 261
Joined: March 12th, 2007, 11:19 pm

Re: keyconfig 20110522

Post by abcuser »

Hi,
I am constantly changing browser language and switch between two URL addresses. I would like to display this two info (language and server name from URL) in title bar.


DETAILS

I have 4 keyboard shortcuts:
First shortcut to change language settings to English:

Code: Select all

Services.prefs.setCharPref("intl.accept_languages", "en"); 

Second shortcut to change language settings to German language:

Code: Select all

Services.prefs.setCharPref("intl.accept_languages", "de");

Third shortcut to change URL to my 'production' server:

Code: Select all

gBrowser.loadURI('http://production.myserver.com/path_to_the_html_file');

Forth shortcut to change URL to my 'test' server:

Code: Select all

gBrowser.loadURI('http://test.myserver.com/path_to_the_html_file');


Is there a way after executing each of above shortcuts to display both 'current language' and 'only current server name from URL address' info in title bar and store the values to be preserved in title bar display after Firefox restart?

I would like to display something like (general syntax):
server_name [language]

Samples:
production.myserver.com [en]
production.myserver.com [de]
test.myserver.com [en]
test.myserver.com [de]

Thanks
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

abcuser wrote:I would like to display something like (general syntax):
server_name [language]

Samples:
production.myserver.com [en]
production.myserver.com [de]
test.myserver.com [en]
test.myserver.com [de]

Use Greasemonkey userscript.

Code: Select all

// ==UserScript==
// @name        whatever
// @namespace   whatever
// @include     /^https?://[a-z-0-9]+\.myserver\.com/.*/
// @grant       none
// ==/UserScript==

document.title = location.hostname + " [" + navigator.language + "]"; 

See http://wiki.greasespot.net/Greasemonkey_Manual.
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, your Greasemonkey script changes title bar according to current tab URL and language settings which is OK. But it ALSO changes title on "tabs" - so tabs now have the same title as browser title bar, but I would like to preserve tab titles. To solve this problem I have added your code for hostname & language to the end of document.title string:

Code: Select all

document.title = document.title + " - " + location.hostname + " [" + navigator.language + "]"; 

Thanks for help, problem solved.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20110522

Post by dorando »

rbfye14 wrote:This doesn't work for me at all :cry:
After pressing new key combination and moving mouse i get js window with the text of this code. And nothing else happens.
That should only happen if the combination was pressed twice, no idea why a mousemove should trigger it.

nigelle wrote:Can you include this in the next standard version ?
On my list of things to consider.
nigelle wrote:Small problem : how to delete the erroneous short-cut ?
You can't delete <key>s not created keyconfig, you can only disable them. Those created with keyconfig will be removed if you reset them.

thuldai wrote:I'd love to change the language of the spell checker using a keyboard shortcut. I found the hint that I could set a shortcut using

Code: Select all

changeLanguage({ target: "en-US", __noSuchMethod__: function() { } });
but it doesn't seem to work. Can anybody here fix this, provide something completely different that works, or confirm that this is currently not possible?
Try

Code: Select all

ChangeLanguage({ target: { value"en-US" }, __noSuchMethod__: function() { } }); 
Support mozilla.dorando.at through donations/contributions.
thuldai
Posts: 10
Joined: June 2nd, 2004, 8:03 am
Location: NYC

Re: keyconfig 20110522

Post by thuldai »

Thanks so much! That totally works!

At first it would change the language back to where it was after half a second or so but uninstalling "quick locale switcher" solved that problem.

So awesome, thanks! Trying to send you a DreamHost gift certificate...
User avatar
digideth
Posts: 54
Joined: May 31st, 2008, 8:48 pm

Re: keyconfig 20110522

Post by digideth »

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).

I checked the error console and here is a screenshot of the error:

Image

Help Please ](*,) :-k #-o

Please! [-o<
Zoolcar9
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)
Contact:

Re: keyconfig 20110522

Post by Zoolcar9 »

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); 
My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."
Post Reply