General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
HotKey (Accelerator?) and Javascript
Posted by: machinesmith
Date: May 20, 2011 06:41PM

Hi All,

I'm trying to figure out a way to assign a snippet of JS to a keyboard hotkey (Ctrl+Space in this case) The aim is to:

1) Bookmark a page to Googlebookmarks, Get a New (and small) window to open
2) After bookmarking, the window should automatically close, and the user can resume browsing

This is the Snippet of code I wanted to use (needs you to be logged into your gmail/google account first):

javascript:function()var%20a=window,b=document,c=encodeURIComponent,d=a.open("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=420px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})();

Can anyone help?

Edit: The
 BBcode seems to be screwing up at my end, let me know if you guys can't read it, I'll remove the tags accordingly



Edited 1 time(s). Last edit at 05/20/2011 06:43PM by machinesmith.

Options: ReplyQuote
Re: HotKey (Accelerator?) and Javascript
Posted by: disrupted(unlogged)
Date: May 20, 2011 09:36PM

thanks for the suggestion.
extension based on your bookmarklet is now available:
http://kmext.sourceforge.net/extensions/gbookmarks.7z

menu: bookmarks> google bookmark
accelerator: shift+g



Edited 1 time(s). Last edit at 05/21/2011 05:46PM by disrupted.

Options: ReplyQuote
Re: HotKey (Accelerator?) and Javascript
Posted by: machinesmith
Date: May 21, 2011 10:18AM

This is...wow...Thank you Tons for this!! I didn't think someone would actually make an extension of it! I was thinking I'd be linked to some old post about binding accelerators or some such and be left to figure it out for myself. Thanks for your awesome work!

Options: ReplyQuote
Re: HotKey (Accelerator?) and Javascript
Posted by: disrupted
Date: May 21, 2011 05:46PM

you're very welcome and thanks for the idea

Options: ReplyQuote


K-Meleon forum is powered by Phorum.