Page 1 of 1

FireGestures and NoScript

Posted: Thu Aug 20, 2009 12:29 am
by Guest
Hi,
I'm trying to toggle on and off NoScript for a website with a mouse gesture, but I can't get it to work.
I want to know the name of the command of the keyboard shortcut, I tried "noscript.keys.toggle" but that doesn't seem to work.

Re: FireGestures and NoScript

Posted: Thu Aug 20, 2009 5:12 am
by Grumpy Old Lady
Hi,
If you mean toggle "temporarily allow" the combo is CTRL SHFT backslash.
A user can't toggle NS itself on the fly. It has to be turned off in the Addons Manager dialog.

Re: FireGestures and NoScript

Posted: Thu Aug 20, 2009 8:33 pm
by Guest
Thanks.
There was probably an easier way, but this is what I came up with, in case someone needs it in the future.

var evt = document.createEvent("KeyEvents");
evt.initKeyEvent(
"keypress",
true,
true,
null,
true, // holds Ctrl key
false, // holds Alt key
true, // holds Shift key
false, // holds Meta key
evt.DOM_VK_BACK_SLASH, // presses a special key, @see http://mxr.mozilla.org/mozilla/source/d ... yEvent.idl
0 // presses a normal key, e.g. "A".charCodeAt(0),
);
document.documentElement.dispatchEvent(evt);

Re: FireGestures and NoScript

Posted: Tue Jun 28, 2011 1:32 pm
by Guest
I recently switched to Firegestures from AIO Gestures just to see if FG could map a gesture for NoScript. Thanks to you, it can! Thank you so much, this has been annoying me for a long time!