[Vimperator] JavaScript for Google Bookmark(let)

cRaig Forrester treehead at gmail.com
Wed Feb 20 13:51:22 PST 2008


Perhaps there is someone can help me out with a little JavaScript I am
trying to implement.  As I am not at all proficient with JavaScript, I
do not know whether this is my lack of Vimperator knowledge or
JavaScript, or both.

I am attempting to reconstitute the Google Bookmark "bookmarklet" as a
JavaScript function in my .vimperatorrc file.  I am implementing the
following, based on an example rc file I found (the indentation is
solely for legibility):

    javascript <<EOF
    gmark = function() {
    var a=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)
    }
    EOF

I am then calling the function (with no effect) in Firefox as follows:

    :js gmark

The original Google bookmarklet is:

javascript:(function(){var
a=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)})();

Also at: http://www.google.com/history

Any suggestions?

cRaig

cRaig Forrester
treehead at gmail.com

"The ignorance of how to use new knowledge stockpiles exponentially."
--Marshall McLuhan

EOM


More information about the Vimperator mailing list