Connecting Tech Pros Worldwide Forums | Help | Site Map

closing a popup window in the new Opera 8

E Michael Brandt
Guest
 
Posts: n/a
#1: Jul 23 '05
I have been lurking here for some time, and now would like to ask a
question of you clever coders:

My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the
face of the new Opera 8. Jspw3 opens a popup window (using
varname=window.open(...)) but there are now two problems:

1) Opera8 interprets a top,left of 0,0 to be top left of the browser
window rather than of the entire screen, unlike the other modern
browsers I've run across.

1-Question) - is there a way to force window.open() interpret 0,0 as the
upper left corner of the *screen* in Opera8?


2) when my opening window's jscript attempts to close the popped window
using varname.close(), Opera8 throws a js error: "Type mismatch
(usually a non-object value used where an object is required)" (This
despite not attempting to close until this condition has been met:

"if
(varname && typeof varname=='object' && !varname.closed)
varname.close()"

2-Question) - any idea how to change the js in the opener so it can
close the popped window object without throwing that error?

Thanks so much.

btw, I've searched the Opera forums to no avail, altho there was some
discussion of a bug that sounds *possibly* related.


--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--

Martin Honnen
Guest
 
Posts: n/a
#2: Jul 23 '05

re: closing a popup window in the new Opera 8




E Michael Brandt wrote:
[color=blue]
> I have been lurking here for some time, and now would like to ask a
> question of you clever coders:
>
> My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the
> face of the new Opera 8. Jspw3 opens a popup window (using
> varname=window.open(...)) but there are now two problems:
>
> 1) Opera8 interprets a top,left of 0,0 to be top left of the browser
> window rather than of the entire screen, unlike the other modern
> browsers I've run across.
>
> 1-Question) - is there a way to force window.open() interpret 0,0 as the
> upper left corner of the *screen* in Opera8?[/color]

Opera treats popup windows not as independent windows but as windows in
another window where one window can host multiple documents (MDI). Thus
I don't think you can use script to position or move such a document
window outside of the boundaries of the main containing window.
It might be possible to change the settings of your Opera browser but I
am not sure how to do that. And of course changing the setting of your
browser does not help if someone visits your pages with Opera and you
want to position popups.
[color=blue]
> 2) when my opening window's jscript attempts to close the popped window
> using varname.close(), Opera8 throws a js error: "Type mismatch
> (usually a non-object value used where an object is required)" (This
> despite not attempting to close until this condition has been met:
>
> "if
> (varname && typeof varname=='object' && !varname.closed)
> varname.close()"[/color]

I can't reproduce that problem here, perhaps you can post the URL to a
test case where we can see that problem.


--

Martin Honnen
http://JavaScript.FAQTs.com/
E Michael Brandt
Guest
 
Posts: n/a
#3: Jul 23 '05

re: closing a popup window in the new Opera 8


Thanks so much for helping with this.

<sigh> I was afraid you'd answer 1Q as you did </sigh>

For 2Q - here is a url: http://valleywebdesigns.com/test/testt.htm
Click the link on that page, note the debug alerts and that the popup
window opens fine. For this first test, do NOT close the popup window,
simply reclick the link on the opener page. Again the popup opens nicely
and all is well. But now CLOSE the popup and click the link again.
Note the debug values in the alerts and then the js error seen in the js
Console.

That test reveals the problem to be that !gJspw3Obj.closed yields TRUE
even when the popup window HAS been closed. So then when
!gJspw3Obj.close() fires, attempting to close an already closed window,
of course the error is thrown.

So, why does Opera8 report !gJspw3Obj.closed to be TRUE when the popup
window is in fact closed?

--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--

Martin Honnen wrote:[color=blue]
>
>
> E Michael Brandt wrote:
>[color=green]
>> I have been lurking here for some time, and now would like to ask a
>> question of you clever coders:
>>
>> My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in
>> the face of the new Opera 8. Jspw3 opens a popup window (using
>> varname=window.open(...)) but there are now two problems:
>>
>> 1) Opera8 interprets a top,left of 0,0 to be top left of the browser
>> window rather than of the entire screen, unlike the other modern
>> browsers I've run across.
>>
>> 1-Question) - is there a way to force window.open() interpret 0,0 as
>> the upper left corner of the *screen* in Opera8?[/color]
>
>
> Opera treats popup windows not as independent windows but as windows in
> another window where one window can host multiple documents (MDI). Thus
> I don't think you can use script to position or move such a document
> window outside of the boundaries of the main containing window.
> It might be possible to change the settings of your Opera browser but I
> am not sure how to do that. And of course changing the setting of your
> browser does not help if someone visits your pages with Opera and you
> want to position popups.
>[color=green]
>> 2) when my opening window's jscript attempts to close the popped
>> window using varname.close(), Opera8 throws a js error: "Type
>> mismatch (usually a non-object value used where an object is
>> required)" (This despite not attempting to close until this condition
>> has been met:
>>
>> "if
>> (varname && typeof varname=='object' && !varname.closed)
>> varname.close()"[/color]
>
>
> I can't reproduce that problem here, perhaps you can post the URL to a
> test case where we can see that problem.
>
>[/color]

Martin Honnen
Guest
 
Posts: n/a
#4: Jul 23 '05

re: closing a popup window in the new Opera 8




E Michael Brandt wrote:
[color=blue]
> Thanks so much for helping with this.
>
> <sigh> I was afraid you'd answer 1Q as you did </sigh>
>
> For 2Q - here is a url: http://valleywebdesigns.com/test/testt.htm Click
> the link on that page, note the debug alerts and that the popup window
> opens fine. For this first test, do NOT close the popup window, simply
> reclick the link on the opener page. Again the popup opens nicely and
> all is well. But now CLOSE the popup and click the link again. Note the
> debug values in the alerts and then the js error seen in the js Console.
>
> That test reveals the problem to be that !gJspw3Obj.closed yields TRUE
> even when the popup window HAS been closed. So then when
> !gJspw3Obj.close() fires, attempting to close an already closed window,
> of course the error is thrown.
>
> So, why does Opera8 report !gJspw3Obj.closed to be TRUE when the popup
> window is in fact closed?[/color]

Looks indeed like a bug in Opera 8, the property named closed becomes
undefined when the popup window is closed so you can't check it anymore
(and !undefined is true which is why you get that result). I have filed
a bug on Opera 8 using
<http://home.arcor.de/martin.honnen/operaBugs/op8/popupWindowClosedTest.html>
as a test case.

--

Martin Honnen
http://JavaScript.FAQTs.com/
E Michael Brandt
Guest
 
Posts: n/a
#5: Jul 23 '05

re: closing a popup window in the new Opera 8


Thank you for confirming this, and for submitting the bug report.

Now I'll have to make a decision about distributing a work-around for
this to all owners of JustSo PictureWindow3. Do you by any chance have
the pulse of Opera development? Enough to know if this is the sort of
thing they will fix quickly? or will it be months? Any idea at all?


--

e michael brandt
michael at valleywebdesigns.com
www.valleywebdesigns.com ::: home of justso picturewindow & photoalbum

--

Martin Honnen wrote:[color=blue]
>
>
> E Michael Brandt wrote:
>[color=green]
>> Thanks so much for helping with this.
>>
>> <sigh> I was afraid you'd answer 1Q as you did </sigh>
>>
>> For 2Q - here is a url: http://valleywebdesigns.com/test/testt.htm
>> Click the link on that page, note the debug alerts and that the popup
>> window opens fine. For this first test, do NOT close the popup
>> window, simply reclick the link on the opener page. Again the popup
>> opens nicely and all is well. But now CLOSE the popup and click the
>> link again. Note the debug values in the alerts and then the js error
>> seen in the js Console.
>>
>> That test reveals the problem to be that !gJspw3Obj.closed yields TRUE
>> even when the popup window HAS been closed. So then when
>> !gJspw3Obj.close() fires, attempting to close an already closed
>> window, of course the error is thrown.
>>
>> So, why does Opera8 report !gJspw3Obj.closed to be TRUE when the popup
>> window is in fact closed?[/color]
>
>
> Looks indeed like a bug in Opera 8, the property named closed becomes
> undefined when the popup window is closed so you can't check it anymore
> (and !undefined is true which is why you get that result). I have filed
> a bug on Opera 8 using
> <http://home.arcor.de/martin.honnen/operaBugs/op8/popupWindowClosedTest.html>
>
> as a test case.
>[/color]
Hallvord R. M. Steen
Guest
 
Posts: n/a
#6: Jul 23 '05

re: closing a popup window in the new Opera 8


On Sat, 21 May 2005 19:08:27 +0200, E Michael Brandt
<michael@valleywebdesigns.com> wrote:
[color=blue]
> Thank you for confirming this, and for submitting the bug report.
>
> Now I'll have to make a decision about distributing a work-around for
> this to all owners of JustSo PictureWindow3. Do you by any chance have
> the pulse of Opera development? Enough to know if this is the sort of
> thing they will fix quickly? or will it be months? Any idea at all?[/color]

It is a known bug and a regression, it should be fixed quite soon but I
can not promise that the fix will be in the next minor release, and I can
not suggest a timeframe. Sorry about the inconvenience caused!
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Richard Cornford
Guest
 
Posts: n/a
#7: Jul 23 '05

re: closing a popup window in the new Opera 8


Hallvord R. M. Steen wrote:[color=blue]
> E Michael Brandt wrote:[color=green]
>> Thank you for confirming this, and for submitting
>> the bug report.[/color][/color]
<snip>[color=blue]
> It is a known bug and a regression, it should be fixed
> quite soon but I can not promise that the fix will be
> in the next minor release, and I can not suggest a
> timeframe. Sorry about the inconvenience caused![/color]

Was it a good idea to let on that you work for Opera? ;-) You might
find yourself being held personally responsible for its shortcomings, or
being barraged with requests/complaints.

Richard.


Hallvord R. M. Steen
Guest
 
Posts: n/a
#8: Jul 23 '05

re: closing a popup window in the new Opera 8


On Wed, 25 May 2005 03:02:44 +0200, Richard Cornford
<Richard@litotes.demon.co.uk> wrote:
[color=blue]
> Was it a good idea to let on that you work for Opera?[/color]

No idea. Time will show :-p
[color=blue]
> ;-) You might find yourself being held personally responsible for its
> shortcomings, or
> being barraged with requests/complaints.[/color]

Now, I work with QA so by definition I'm already personally responsible
for anything that is broken ø-)

Seriously I don't mind requests and complaints, and I hope I can now and
then help posters who need some help with Opera. Of course the
so-limited-it's-virtually-non-existant time I can afford spending on
newsgroups means that I won't really be a regular contributor, and I'm
afraid noone can *expect* a response because I may be too busy to follow
the newsgroup.

... it's always possible to register and use http://support.opera.com/
anyway :-)

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Closed Thread