Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: =?UTF-8?B?UGV0ZXIgQsO8dHRuZXI=?= Newsgroups: comp.lang.javascript Subject: Re: How to check if a key is currently down ... Date: Wed, 27 Mar 2019 19:26:04 +0100 Lines: 71 Message-ID: References: Reply-To: peter.buettner@gmx.net Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net QuqZLABW4IOkymQsibmxLABei285P7KKjnBnm+BTWuAN/9M1Cz Cancel-Lock: sha1:RKq7QSi8bRcDJfeZcjLLJ54gjKk= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5 In-Reply-To: Xref: csiph.com comp.lang.javascript:36194 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: 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 (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