Re: opening a link in a new window (hope this is ok for this list)

 "todd fahrner" <fahrner@pobox.com>
> On Tuesday, February 19, 2002, at 09:38 AM, Jim Ley wrote:
> > false succeeds, example browsers , pocket IE, AvantGo always,
Mozilla,
> > IE, Opera under configuration, other browsers will just error and may
> > well recover to navigate to the url.
>
> Script is now updated to confirm whether window was spawned before
> returning false. Limited testing suggests viability - want to throw
> your worst at it?

Snufkin (my every day browser) - fails no-op.
Microsoft Pocket IE - Script Error, then recovery to the 404 page.
Mozilla 0.9.8 works - but no configuration option to disable windows
opening - UAAG violation AIUI
Any browser with Proximitron (this does the same as Snufkin, but is
probably used by more than 3 people! I believe other similar proxy
window.open blockers do the same) it fails - no-op the reason is to
prevent javascript errors, they return a reference to the current window
when they supress window.open - so you can't detect - you could perhaps
do:

window.name="moomin"
windowref=window.open('','snork')
if (windowref && windowref.name=='snork') return false
return true

but I can still see that failing my snufkin it does fail in (I don't let
people name my windows) but that's me, and you can probably forget about
me.

> > and self.focus() is not a solution in many scenarios, and is a
> > WCAG 1.0 A
> > violation, so is clearly not an option.
>
> Can you give me a chapter-and-verse on that?

I apologise, that was of course my mistake it's a UAAG requirement
(guideline 5), of course browsers aren't UAAG compliant in this, so I'd
certainly want to be kind to the users.  My own memory was effected by
the fact this is a usability problem for me.

> Of course, opening new windows at all ("until
> user agents" yadda yadda) is a violation, so we're probably moot.

Indeed, my other prohibition was that it simply doesn't work - almost
every window manager prevents applications taking control of focus - of
course in that situation nothing bad probably happens.

> I think you are too ready to ascribe godlike qualities to human
> spec/guideline authors.

using a target attribute and not returning false is a much safer method:

<a href="moomin.html" onclick="this.target='moomin';if (window.open)
window.open('','moomin');"> [1]

Seems to me to be much safer - of course - I'd use a HTML dtd that
allowed me a target attribute, but if you really don't want to the above
seems much safer.

Jim.

Received on Friday, 22 February 2002 17:09:27 UTC