Closed
Bug 142555
Opened 23 years ago
Closed 4 years ago
early cross window javascript function calls fail
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
RESOLVED
INVALID
People
(Reporter: stefan.p, Unassigned)
Details
Attachments
(2 files)
When you create a new window (using window.open) and call a
javascript function defined in that window, the call fails
and the javascript console reports 'is not a function'.
The same function call done after the window is initialised and
completely drawn works ok.
It looks like the window.open function returns too quickly, before the new
window is ready.
Tested on 1.0 RC1 and latest nightly build (2002041711??)
Related ?
I've looked for that on bugzilla, it looks like people have reported the same
kind of problems for javascript to java (actually plugins in general).
See bug #106253
Reporter | ||
Comment 1•23 years ago
|
||
Reporter | ||
Comment 2•23 years ago
|
||
Comment 3•23 years ago
|
||
Browser, not engine --> DOM Level 0.
jst: is this a duplicate of bug 52238, "window handle returned by
open/openDialog does not provide a handle to a valid js context" ?
(marked INVALID)
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale
Reporter | ||
Comment 4•23 years ago
|
||
Hmm
I've had a look at bug 52238
It looks like the same bug.
The thing that bothers me is that the javascript function (or in case of bug
52238, the variable) is really defined, or will be (some milliseconds after the
call).
So how do you know when it's ok to call stuff on the new window ?
The fact that it's really a pain to do in javascript (no threads, no sleep, ...)
makes me think that it would be ok to handle it in the browser, just by
returning from window.open when the new window is done loading - for example
around the time onLoad is executed; or even by adding a small tempo
I realize it can be an endless thin - what about variables defined later etc..
but at least 'static' code defined right in <script> tags should be available by
the time window.open returns
No ?
Comment 5•22 years ago
|
||
is this related to bug 159424?
Comment 6•22 years ago
|
||
No, not related to bug 159424.
Comment 8•21 years ago
|
||
This _might_ be the same regression I saw from 1.6 to 1.7beta where window.open
fails on a onMouseDown in the following page:
http://www.newseum.org/todaysfrontpages/
Quick test: click on one of the front page thumbnails in the array; you should
see a new window pop up of the chosen front page image. I don't. Javascript
was enabled for Navigator, scripts were allowed to do everything, even the new
"Disable or replace context menus" option. My 1.6 settings were different for
the "allow scripts" options, but my original 1.6 settings failed too, which is
why I tested with all settings checked.
Unlike the earlier comments, the Javascript console does _not_ report the
failure. Also unlike original bug, this was on Windows XP.
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: desale → general
Comment 9•6 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046
Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.
If you have questions, please contact :mdaly.
Priority: -- → P5
Comment 10•4 years ago
|
||
This is not how window.open()
works. The initial document it creates is about:blank and that won't have the functions. You'll have to wait for the specified document to be loaded.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•