Closed
Bug 122266
Opened 23 years ago
Closed 3 years ago
Javascript can't create pop-up window
Categories
(Core :: DOM: Core & HTML, defect, P5)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: lopaki, Unassigned)
Details
Attachments
(2 files)
This code snippet makes a new window pop up with two other browsers. It just makes this mozilla wiggle. To open the window.... function GetHeight(defhei) { var ah = window.screen.availHeight - 30; if ( ah > defhei ) { ah = defhei; } return ah; } <script language="JavaScript"> //this script opens the window page = 'frame_work.cfm?req_no='+document.temp.l_req_no.value+'&pagetype=EDIT&re q_type='+document.temp.l_req_type.value; var pAttrib = "toolbar=Yes,scrollbars=Yes,resizable=yes,width=700,height=" + GetHeight(720); window.open(page, "CARESWindow", pAttrib); </script>
Comment 1•23 years ago
|
||
Hi - the form wouldn't let me put in version. It is mozilla-0.9.7-0.i386.rpm. --Scott
Comment 2•23 years ago
|
||
Do you have the preference to prevent pages from opening windows by themselves set?
Comment 3•23 years ago
|
||
Browser, not engine. Reassigning to Browser-General until we can get more info. Will attach the reduced testcase below, with |page| changed from page = 'frame_work.cfm?req_no='+document.temp.l_req_no.value+'&pagetype=EDIT&re q_type='+document.temp.l_req_type.value; to page = 'http://www.mozilla.org';
Assignee: rogerl → asa
Component: JavaScript Engine → Browser-General
QA Contact: pschwartau → doronr
Comment 4•23 years ago
|
||
Comment 5•23 years ago
|
||
The reduced testcase works fine for me with Mozilla binaries dated 20020125xx on WinNT, Linux, and Mac9.1. Scott: 1. See the Prefs question in Comment #2 above; that's set in Edit > Preferences > Advanced > Scripts & Windows > Allow scripts to ... etc. 2. Could you provide the URL where the code snippet comes from? That way we can debug it 3. Is Mozilla hanging on this, or just not executing? 4. If the latter, are there any errors in Tasks > Tools > JavaScript Console? (Be sure to clear it out of any previous errors first) 5. How does the reduced testcase work for you?
Comment 6•23 years ago
|
||
Comments from Scott in email: Under "Scripts and Windows" > "Allow scripts to do the following", "Open windows by themselves" is checked
testcase in attachment 66808 [details] WFM (3h old cvs build, linux)
Reporter | ||
Comment 8•23 years ago
|
||
Reduced test case works for me, too. I will ask our app developer if this javascript console error means anything to him. Always good to attack from two directions.
Comment 9•23 years ago
|
||
Oh, and does a window named "CARESWindow" already exist in your app? If that window has the code in question run in it you would not get a new window and _would_ get the "wiggle" effect. Of course in that case the same thing should happen in other browsers...
Comment 10•23 years ago
|
||
Scott reports: > 1. See the Prefs question in Comment #2 above; that's set in > Edit > Preferences > Advanced > Scripts & Windows > Allow scripts to ... etc. All boxes checked. > 2. Could you provide the URL where the code snippet comes from? > That way we can debug it I don't think "they" will go for that, but I will see if they will let me give you a tempory account. > 3. Is Mozilla hanging on this, or just not executing? I hit the Submit button, there is a pause like the app is hitting the database, and then the whole browser drops about 10-20 pixels on the screen. No hang. > 4. If the latter, are there any errors in Tasks > Tools > JavaScript Console? > (Be sure to clear it out of any previous errors first) Yes! Error: document.temp has no properties Source File: https://dobby.niehs.nih.gov/cares/support/searchbyarnum.cfm
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
http://icewind2.blackisle.com/screens.html provides an instance where the popup window does not work correctly. Clicking on any image provides a flashing window.
Comment 13•23 years ago
|
||
That site has broken client-sniffing: var NS = (document.layers) ? 1 : 0; win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no"); if (NS) { sWidth = win.innerWidth; sHeight = win.innerHeight; } else { sWidth = win.document.body.clientWidth; sHeight = win.document.body.clientHeight; } if(sWidth!=ix || sHeight!=iy) { win.close(); return; } In this case there is no document in the window when the width/height checking code runs. So sWidth and sHeight (which get set on the IE branch) are wrong.... and the window gets closed.
Comment 14•23 years ago
|
||
->DOM
Assignee: asa → jst
Status: UNCONFIRMED → NEW
Component: Browser-General → DOM Level 0
Ever confirmed: true
QA Contact: doronr → desale
Comment 15•22 years ago
|
||
All testcase WFM on mozilla1.0. win.document.body.clientWidth/Height has correct value in mozilla. We supports both win.innerWidth and win.document.body.clientWidth?
Comment 16•22 years ago
|
||
Worksforme, Linux SuSE 7.3, Moz nightly 2003021905
Comment 18•21 years ago
|
||
Marking invalid per comment 13
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
Reporter | ||
Comment 19•21 years ago
|
||
Okay - I guess Netscape and IE are broken for working properly. <shrug> --Scott
Comment 20•21 years ago
|
||
Scott, the site purposefully executes one set of code in IE and another in NS4. In Mozilla it executes a mix of the two sets of code. It looks like this: w = window.open; if (IE) { w.browser = "ie"; } else { w.browser = "ns"; } if (NS4) { if (w.browser != "ns") w.close(); } else { if (w.browser != "ie") w.close(); } Trace through this code, keeping in mind that in Mozilla both "NS4" and "IE" are false (since it's neither). So all three browsers are working properly; the bug is in the page itself.
Reporter | ||
Comment 21•21 years ago
|
||
Boris, I can't find where our site does that client sniffing and the developer says that he doesn't do it. Are you referring to the site in comment 12? --Scott
Comment 22•21 years ago
|
||
Ah, sorry. Yes, I got confused about the comments that had nothing to do with this bug. Reopening.... Scott, have you had any luck with getting a testcase that does reproduce the problem? It's a little hard to fix as things stand. ;)
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Comment 23•21 years ago
|
||
Scott, any chance of a page showing this bug?
Updated•15 years ago
|
Assignee: general → nobody
QA Contact: desale → general
Comment 24•7 years ago
|
||
Similar, but not a duplicate of: Bug 1390490 - "middle" or command-clicking on link opens new "pop up" window, instead of opening link in new tab
Updated•6 years ago
|
Priority: -- → P5
Updated•3 years ago
|
Status: REOPENED → RESOLVED
Closed: 21 years ago → 3 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•