By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,626 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,626 IT Pros & Developers. It's quick & easy.

closing a popup window in the new Opera 8

P: n/a
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

--
Jul 23 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a


E Michael Brandt wrote:
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?
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.
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()"


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/
Jul 23 '05 #2

P: n/a
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:


E Michael Brandt wrote:
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?

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.
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()"

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


Jul 23 '05 #3

P: n/a


E Michael Brandt wrote:
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?


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/
Jul 23 '05 #4

P: n/a
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:


E Michael Brandt wrote:
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?

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.

Jul 23 '05 #5

P: n/a
On Sat, 21 May 2005 19:08:27 +0200, E Michael Brandt
<mi*****@valleywebdesigns.com> wrote:
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?


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/
Jul 23 '05 #6

P: n/a
Hallvord R. M. Steen wrote:
E Michael Brandt wrote:
Thank you for confirming this, and for submitting
the bug report.
<snip> 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!


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.
Jul 23 '05 #7

P: n/a
On Wed, 25 May 2005 03:02:44 +0200, Richard Cornford
<Ri*****@litotes.demon.co.uk> wrote:
Was it a good idea to let on that you work for Opera?
No idea. Time will show :-p
;-) You might find yourself being held personally responsible for its
shortcomings, or
being barraged with requests/complaints.


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/
Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.