[TAG] 2-cent Tip: Web development bookmarklets

Ben Okopnik ben at callahans.org
Wed Apr 14 18:31:19 MSD 2004


On Wed, Apr 14, 2004 at 09:58:13AM -0500, John Karns wrote:
> On Tue, 13 Apr 2004, Ben Okopnik so eloquently said:
> 
> > Well, grumble no more - just add these URLs to your "Personal bookmarks"
> > so that they'll show prominently in your browser's toolbar, and resize
> > as desired with a single click! Note: the lines beginning with
> > "javascript" are the actual URLs; the names are up to you.  My comments
> > are preceded with a '#' sign and aren't part of the bookmarklets.
> > 
> > 
> > # 640x480 bookmarklet
> > javascript:window.resizeTo(640,480)
> > 
> > # 800x600 bookmarklet
> > javascript:window.resizeTo(800,600)
> > 
> > # 1024x768 bookmarklet
> > javascript:window.resizeTo(1024,768)
> 
> Nice tip!  Thanks.  However, I'm also using Mozilla 1.6 with java plugin
> 1.4.2, and it won't work here.  Maybe I'm doing something wrong - I just 
> entered the javascript line in the URL input field as I would with any 
> other URL.
 
Nope, that should have done it. On the other hand, these things do seem
to be pretty touchy with regard to browser type and other variables. I'm
at 1.6 myself, so it seems odd that it wouldn't work for you.

> Help/About Plug-ins yields
> 
>     File name: libjavaplugin_oji.so
>     Java(TM) Plug-in 1.4.2
 
That has more to do with Java than JavaScript (the two aren't really
related, odd as it may sound.) Do you have JS enabled in your
preferences?

> Any ideas on where to look or how to test my java setup?  I don't seem to 
> get java errors when browsing sites, and have installed various helper 
> applets such as the Google toolbar with success.

Hmm. Try this:

# This is the way the original bookmarklet was done; only the
# outerHeight() invocation worked for me.
javascript:void(outerWidth=640);void(outerHeight=480)

Play with innerHeight(y), outerHeight(y), and window.resizeTo(x,y) -
that's what I did.


* Ben Okopnik * okopnik.freeshell.org * Technical Editor, Linux Gazette *
-=-=-=-=-=o0o=-=-=-=-= <http://linuxgazette.net/> =-=-=-=-=o0o=-=-=-=-=-




More information about the TAG mailing list