[Vimperator] JavaScript for Google Bookmark(let)
M.Terada
teramako at gmail.com
Sat Feb 23 08:20:14 PST 2008
HI.
:js command is executed in chrome window, not the window of the
current web page.
You mybe need to replace "window" to "window.content.document.window"
and replace "document" to "window.content.document"
On Thu, Feb 21, 2008 at 6:51 AM, cRaig Forrester <treehead at gmail.com> wrote:
> 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
> _______________________________________________
> Vimperator mailing list
> Vimperator at mozdev.org
> https://www.mozdev.org/mailman/listinfo/vimperator
>
--
teramako
More information about the Vimperator
mailing list