Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #36194
| From | Peter Büttner <not_for_mail_peb@gmx.net> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: How to check if a key is currently down ... |
| Date | 2019-03-27 19:26 +0100 |
| Message-ID | <gg1thtFa2vsU1@mid.individual.net> (permalink) |
| References | <q79vlh$1li$1@gioia.aioe.org> <gfsif9F4cf9U1@mid.individual.net> <q7b6b4$1mqo$1@gioia.aioe.org> |
Am 25.03.2019 19:23, schrieb R.Wieser:
> Peter,
>
>> Like the idea.
>
> Thanks. :-)
>
>> But AFAIK all/most browsers use those modifiers to open a bookmark/link in
>> a new window or tab, so your idea may interfere with the default behavior.
>
> First I have to find a way to capture a key, after that I can worry about
> which one to use. Maybe even one of the printscreen, scrolllock or
> pause/break ones. Or the insert, home or end ones. They seem to behave
> rather neutral.
>
>> I do it this way:
>> store a bookmark with a hash:
>
> For what I'm currently aiming at that won't work too well: I'm trying to
> scrub googles result pages of the (rather random and more-often-than-not
> fully unusable) "Images of {the exact searchterm}". Appending such a hash
> does not seem to want to stick (just tried. :-) )
Here it stays:
<https://www.google.com/search?q=foobar&#foo>
But on the next page it is removed. Maybe store a flag with GM
and do your action on the next page if it is set, and add a button
to remove the flag, or set the flag for the search word.
Well, add the hash to all the 'next page links', that seems to stay.
Since the hash isn't send to the server only client side code can
remove it, so chances are good that tis works for a long time.
>> Another approach maybe the useractions of GM.
>
> Do you maybe have a bit more info on that ? I've just done a quick google
> for it but I got back zilch. And the build-in link to the "manual" is
> rather ... underwhelming. :-(
Before:
That may not help you since works after page load and the user needs
to activate the menuitem. That behavior can also be implemented by
a simple button anywhere on the page (hide the images always and only
show them on a click on the new created element)
The 'User Script Commands' were removed in GM 4.
To use it in older versions:
// @grant GM_registerMenuCommand
GM_registerMenuCommand("Do Foo", function(){ alert("Foo");}, "f");
That adds a menuitem to the GM Menu like in
<https://camo.githubusercontent.com/2fda602ca65f6109511d7314d4dbb6b5e4754523/687474703a2f2f7765622e617263686976652e6f72672f7765622f3230313731303035303632343335696d5f2f68747470733a2f2f77696b692e67726561736573706f742e6e65742f696d616765732f372f37612f57696e372d6666342d746f6f6c6261722d6d6f6e6b65792d6d656e752e706e67>
(Here it is grayed since no commands are registered)
https://wiki.greasespot.net/GM_registerMenuCommand
Here a discussion:
https://github.com/greasemonkey/greasemonkey/issues/2714
Since the alternative 'Context Menu' won't work there maybe
a chance that the developers reimplement those menu commands
as before.
Peter
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to check if a key is currently down ... "R.Wieser" <address@not.available> - 2019-03-25 08:23 +0100
Re: How to check if a key is currently down ... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-03-25 02:33 -0700
Re: How to check if a key is currently down ... "R.Wieser" <address@not.available> - 2019-03-25 11:48 +0100
Re: How to check if a key is currently down ... Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-03-25 02:39 -0700
Re: How to check if a key is currently down ... Julio Di Egidio <julio@diegidio.name> - 2019-03-25 04:08 -0700
Re: How to check if a key is currently down ... JJ <jj4public@vfemail.net> - 2019-03-25 19:42 +0700
Re: How to check if a key is currently down ... "R.Wieser" <address@not.available> - 2019-03-25 17:21 +0100
Re: How to check if a key is currently down ... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-26 17:09 +0100
Re: How to check if a key is currently down ... Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-26 16:12 +0000
Re: How to check if a key is currently down ... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-26 17:35 +0100
Re: How to check if a key is currently down ... Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-26 16:48 +0000
Re: How to check if a key is currently down ... Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-03-26 18:29 +0100
Re: How to check if a key is currently down ... Jon Ribbens <jon+usenet@unequivocal.eu> - 2019-03-26 17:36 +0000
Re: How to check if a key is currently down ... Julio Di Egidio <julio@diegidio.name> - 2019-03-26 18:23 -0700
Re: How to check if a key is currently down ... Peter Büttner <not_for_mail_peb@gmx.net> - 2019-03-25 18:46 +0100
Re: How to check if a key is currently down ... "R.Wieser" <address@not.available> - 2019-03-25 19:23 +0100
Re: How to check if a key is currently down ... Peter Büttner <not_for_mail_peb@gmx.net> - 2019-03-27 19:26 +0100
Re: How to check if a key is currently down ... "R.Wieser" <address@not.available> - 2019-04-05 09:23 +0200
Re: How to check if a key is currently down ... Peter Büttner <not_for_mail_peb@gmx.net> - 2019-04-07 19:53 +0200
csiph-web