MozillaZine


keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted August 31st, 2015, 1:49 pm

Brummelchen wrote:the eval() function kills nearly all personal add-ons when send for signing.
concerning keyconfig (and more) the setAttribute is easy to replace (same for setTimeout and similar)

for keyconfig just comment out the concerning function (4 lines) - this entry in prefs seems to be empty here and i dont see any relevance to any other function.

the major change would be to transport the settings from "keyconfig.bla" to "extensions.keyconfig.bla" - a first attempt was refused.
I submitted for manual review

without change of eval()) it wont be signed - word. eval() is a must change like other code

at least i miss is the highlighting of doubled keys. i dont know (or forgot) if it was present anytime.
if some need a more sophisticated add-on for this try s3.menu-wizard
viewtopic.php?f=48&t=2828771

HTH

setAttribute : The occurrence I looked at seemed to be where the code, read from the appropriate pref, is attached to the key combination, as the 'oncommand' of its 'key' element. Without that, the required action would not be performed when the key combination was pressed. Am I completely misunderstanding that bit of it?

I do not see any alternative, since any 'onkeypress' or whatever it is, has to be associated with a target control (button, window, textbox etc) and might be overridden with something like 'stoppropagation' or similar elsewhere. Moreover, the only way one could apply this without regard to whatever had focus at the time would be to attach a listener to the ?browser? or the window and hope nothing else interfered.

Just in passing, is the 'key' one would check for inside a listener allowed to be the id/name of a 'key' element, which, in turn, specifies a key combination?

The oncommand attribute of a 'key' element, seems to me, to be the only way to directly associate an action with just a key combination, whatever happens to be focussed at the time.

eval : why would that be disallowed in a private submission where there are actually rather a lot of public extensions, some of an extremely similar nature in at least part of their function, where it has been allowed and they have been signed?

menu-wizard : an excellent extension which I already use. Unfortunately, as far as I can see, it can only be used to edit existing shortcuts, not to create new ones.
Also, I do not see any way to sort the shortcuts in such a way as to make locating a particular one less than painful.

Anyway, having taken all one night simply to discover and identify the 'key' element as central to much of keyconfig and having travelled via the 'command' element, which is described in the Mozilla documentation but which, after much time spent, I read is not, and never was, supported by Mozilla, I rather doubt if I shall be making any major keyconfig changes in my lifetime.

Since you sound very confident in the field, I hope that you are well on your way to producing a public fork of keyconfig and we shall all have the benefit of it.

If this is the case, how soon do you think you might complete?

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted August 31st, 2015, 3:08 pm

morat wrote: .. I got rejected because keyconfig uses the eval() function, but I think the extension would pass on manual review.
..

Well, you were quite right :D It was signed and I've installed it in one profile now. Thank you very much for your advice and improvements.

I don't know if the case mooz made for keysnail was taken to heart or if mentioning that and others did the trick, but when I looked yesterday my submission was 388 out of 389 and, early this morning it was passed and signed. Pretty fast work.

I wonder if that rapid response was because a lot of other private submissions were already made for keyconfig clones.

It does mean that anyone else who follows the same process should get through, although I still really wish someone would come up with a publicly listed version on AMO.

Brummelchen
 
Posts: 4616
Joined: March 19th, 2005, 10:51 am

Post Posted September 1st, 2015, 1:21 am

any setAttribute on* command should be replaced by addEventListener - you should follow that hint if you read the submission report in detail
setAttribute(onlick,"function();"); -> addEvenlistener(click, function(), false);
you should read the MDN
https://developer.mozilla.org/en-US/doc ... ntListener

to replace eval() it need some further investigation for the expected result. some it can be replaced with json.parse() - some it need a complete new function. eval() returns a result from string. but json is not simple for beginner (so am i).

I wonder if that rapid response was because a lot of other private submissions were already made for keyconfig clones.

signing does not depend on quantity - more on the valuable member which submitted it.
i submitted a special add-on and it was dismissed - some other submitted same and it got signed within a day.
i dont offer any public add-on, all are for my own purpose and modded in some manner for my needs. some mods were gone now - less modifications for my ego, i replaced it with the original.

cheers

PS no fullquotes please, only text you really rely on!

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 2nd, 2015, 7:51 am

RDL wrote:
morat wrote: .. I got rejected because keyconfig uses the eval() function, but I think the extension would pass on manual review.
..

Well, you were quite right :D It was signed and I've installed it in one profile now. Thank you very much for your advice and improvements.

I don't know if the case mooz made for keysnail was taken to heart or if mentioning that and others did the trick, but when I looked yesterday my submission was 388 out of 389 and, early this morning it was passed and signed. Pretty fast work.

I wonder if that rapid response was because a lot of other private submissions were already made for keyconfig clones.

It does mean that anyone else who follows the same process should get through, although I still really wish someone would come up with a publicly listed version on AMO.



Hello,
Could you provide signed keyconfig.xpi to us?

morat
 
Posts: 4345
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 2nd, 2015, 12:17 pm

@RDL

I'm glad you got it signed.

:D
RDL wrote:My mouse is much loved but too old to have more than basic support on Win 7. Logitech has refused to provide up-to-date management software for it.

I'm using X-Mouse Button Control with my Logitech MX500 optical mouse.

morat
 
Posts: 4345
Joined: February 3rd, 2009, 6:29 pm

Post Posted September 2nd, 2015, 12:25 pm

The more technically advanced users can use the signed userChromeJS extension as a simple alternative to the unsigned keyconfig extension.

http://userchromejs.mozdev.org/
http://userchromejs.mozdev.org/faq.html

Here is an example:

* disable: File > Print… (Ctrl+P)
* override: Edit > Select All (Ctrl+A), runs alert("alpha")
* override: View > Sidebar > Bookmarks (Ctrl+B), runs alert("beta")
* create: Ctrl+Shift+1, opens the Page Info window in Tools menu
* create: Alt+F1, opens the Troubleshooting Info tab in Help menu

Code: Select all
/* Firefox userChrome.js */

/*

Why doesn't a script change take effect on restart?
Gecko has a javascript cache, which is not automatically cleared across restarts.
To clear the cache when restarting, add a -purgecaches flag to the executable commandline.

i.e.

firefox.exe -purgecaches
FirefoxPortable.exe -purgecaches

Reference:

view-source:chrome://browser/locale/browser.dtd
view-source:chrome://browser/content/browser.xul

userChromeJS
http://userchromejs.mozdev.org/
http://userchromejs.mozdev.org/faq.html

DOM Inspector
http://addons.mozilla.org/firefox/addon/6622
http://developer.mozilla.org/en/DOM_Inspector

*/

(function() {

if (location == "chrome://browser/content/browser.xul") {

  // create a global object
  window.userChromeMainKeysetTweak = {
    alpha: function() {
      alert("alpha");
    },
    beta: function() {
      alert("beta");
    },
  };

  // File > Print… (Ctrl+P)
  var key = document.getElementById("printKb");
  var menuitem = document.getElementById("menu_print");
  // disable <key>
  key.setAttribute("disabled", "true");
  // remove the accelerator text for that <menuitem>
  menuitem.removeAttribute("key");
  menuitem.setAttribute("acceltext", "");
  menuitem.removeAttribute("acceltext");

  // Edit > Select All (Ctrl+A)
  var key = document.getElementById("key_selectAll");
  var menuitem = document.getElementById("menu_selectAll");
  // override <key>
  key.setAttribute("oncommand", "userChromeMainKeysetTweak.alpha();");
  // remove the accelerator text for that <menuitem>
  menuitem.removeAttribute("key");
  menuitem.setAttribute("acceltext", "");
  menuitem.removeAttribute("acceltext");

  // View > Sidebar > Bookmarks (Ctrl+B)
  var key = document.getElementById("viewBookmarksSidebarKb");
  var menuitem = document.getElementById("menu_bookmarksSidebar");
  // override <key>
  key.removeAttribute("command");
  key.setAttribute("oncommand", "userChromeMainKeysetTweak.beta();");
  // remove the accelerator text for that <menuitem>
  menuitem.removeAttribute("key");
  menuitem.setAttribute("acceltext", "");
  menuitem.removeAttribute("acceltext");

  // Ctrl+Shift+1
  // create <key>
  var key = document.createElement("key");
  key.id = "key_userChromeMainKeysetTweak_1"; // unique identifier
  key.setAttribute("key", "!");
  key.setAttribute("modifiers", "accel,shift");
  key.setAttribute("command", "View:PageInfo");
  // append <key>
  document.getElementById("mainKeyset").appendChild(key);

  // Alt+F1
  // create <key>
  var key = document.createElement("key");
  key.id = "key_userChromeMainKeysetTweak_2"; // unique identifier
  key.setAttribute("keycode", "VK_F1");
  key.setAttribute("modifiers", "alt");
  key.setAttribute("oncommand", "openTroubleshootingPage();");
  // append <key>
  document.getElementById("mainKeyset").appendChild(key);

  // void the key cache for that <keyset>
  var keyset = document.getElementById("mainKeyset");
  keyset.parentNode.insertBefore(keyset, keyset.nextSibling);

}

})();

That works for me with the following setup.

userChromeJS 2.0 (signed)
Firefox 40.0.3
Windows 7 SP1 32-bit

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted September 2nd, 2015, 1:46 pm

ybbao wrote: ..Could you provide signed keyconfig.xpi to us?

I'm not able to attach it to a post or a PM (Private Message) or an email in/from this forum. Since I'm too paranoid to register on a hosting site I can't link it that way and, although, as I understand it, I'm free to share the unlisted extension, I'd be very surprised if linking to the .xpi on AMO would work, let alone be acceptable to them.

However, if you PM me, including a suitable email address, I'd be happy to send you a copy. If, additionally, you have the means to upload it somewhere and link here to that, then 'you' becomes 'us' as you requested. Whichever way, I'll keep my eye open for your PM.

Please keep in mind that the real developer is still Dorando, to whom most credit is due, and that Morat was a major agent by encouraging me to submit it (and providing some worthwhile improvements). The actual submission was surprisingly painless :)
Last edited by RDL on September 2nd, 2015, 5:55 pm, edited 1 time in total.

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted September 2nd, 2015, 3:11 pm

morat wrote:@RDL

I'm glad you got it signed.

:D
RDL wrote:My mouse is much loved but too old to have more than basic support on Win 7. Logitech has refused to provide up-to-date management software for it.

I'm using X-Mouse Button Control with my Logitech MX500 optical mouse.

Thanks for that, and further ideas on mouse buttons. For the immediate need, which was trying out the 'Multi Menu' in 'Custom Buttons', I went into the 'forbidden' zone of the button and added one line of code to make Ctrl-LeftClick behave like 'MiddleClick' so I didn't need the thumb button this time.

However, I now keep X-Mouse Button Control and AutoHotKeys in the back of my head in case of unavoidable need.

Morat wrote:The more technically advanced users can use the signed userChromeJS extension as a simple alternative to the unsigned keyconfig extension.

One of the most valuable features of keyconfig is that it shows all (most of) the existing bindings so one has a map to steer one's way. I suppose one could reproduce that in userChromeJS by using chunks of keyconfig's code associated with a table object (except that a closer look says there's no such thing as a 'table object' in javascript) and displaying the table but that's a guess and I'm much happier leaving it to Dorando's tried and tested software :)

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 3rd, 2015, 5:47 am

@RDL
I pm message to you.
Last edited by ybbao on September 3rd, 2015, 4:58 pm, edited 2 times in total.

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted September 3rd, 2015, 3:00 pm

ybbao wrote:@RDL
"My E-mail is now in the public domain". Thanks.

Dear ybbao

You should never, ever put your email address in a post on any forum. Anyone who wants can read it and there is even automatic software which looks for such things on the internet.

Please edit your post at once and remove your email address from the post.

If you are very lucky, no-one will have noticed. Otherwise,expect a mass of spam and perhaps even having your address used to look like the sender of malevolent emails.

I did ask you to send your address in a 'PM', which I explained, earlier, was a 'Private Message'. However, I realise that I should have repeated the full two words to make it more obvious. If you follow the link '0 new messages' top right of this page, that should make things clearer. If the author permits, there is a button, left of each forum post, enabling you to directly PM the post author. That's next to one which allows you to email them (also only if they permit it).

I'm sorry that I can't use your email now, since:
a) having published it in the open, you cannot trust any software sent, supposedly by me, to that address. The sender could be anyone and the software could be malware.
b) on top of that, If you then innocently distributed that malware, there could be lots of victims.

I know that it would be more difficult for nasties to do this without upsetting the signed status but these people are sometimes unpleasantly clever.

Fortunately, someone else has PM'd me and I have sent the .xpi to them. Hopefully, they will be able to provide everyone with a safe link but, if not, I could send another copy to someone else who can.

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 3rd, 2015, 5:00 pm

RDL wrote:
ybbao wrote:@RDL
"My E-mail is now in the public domain". Thanks.

Dear ybbao

You should never, ever put your email address in a post on any forum. Anyone who wants can read it and there is even automatic software which looks for such things on the internet.

Please edit your post at once and remove your email address from the post.

If you are very lucky, no-one will have noticed. Otherwise,expect a mass of spam and perhaps even having your address used to look like the sender of malevolent emails.

I did ask you to send your address in a 'PM', which I explained, earlier, was a 'Private Message'. However, I realise that I should have repeated the full two words to make it more obvious. If you follow the link '0 new messages' top right of this page, that should make things clearer. If the author permits, there is a button, left of each forum post, enabling you to directly PM the post author. That's next to one which allows you to email them (also only if they permit it).

I'm sorry that I can't use your email now, since:
a) having published it in the open, you cannot trust any software sent, supposedly by me, to that address. The sender could be anyone and the software could be malware.
b) on top of that, If you then innocently distributed that malware, there could be lots of victims.

I know that it would be more difficult for nasties to do this without upsetting the signed status but these people are sometimes unpleasantly clever.

Fortunately, someone else has PM'd me and I have sent the .xpi to them. Hopefully, they will be able to provide everyone with a safe link but, if not, I could send another copy to someone else who can.



I have PM to you. Thanks your reminding.

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 4th, 2015, 8:41 am

...........

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted September 4th, 2015, 5:27 pm

RDL wrote:..Fortunately, someone else has PM'd me and I have sent the .xpi to them. Hopefully, they will be able to provide everyone with a safe link but, if not, I could send another copy to someone else who can.

Sadly, they could not, and I did mean "if there is anyone else who can", so..

ybbao
 
Posts: 13
Joined: August 23rd, 2010, 2:38 am

Post Posted September 4th, 2015, 11:46 pm

@RDL Do you have receive my PM?

RDL
 
Posts: 1258
Joined: August 22nd, 2004, 1:39 am

Post Posted September 5th, 2015, 2:16 pm

ybbao wrote:@RDL Do you have receive my PM?

I have received just one PM from you, with exactly that same email address I cannot use because you already published it in open view.

I replied (by PM) and you appear to have read my reply.

Since then I have not received any other PM from you.

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests