Closed Bug 177819 Opened 22 years ago Closed 3 years ago

Error: uncaught exception: [nsIDOMJSWindow.open]

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86
Windows 98
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: adrianw, Unassigned)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
Build Identifier: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020826

Error: uncaught exception: 
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE)
[nsIDOMJSWindow.open]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS
frame :: https://66.134.31.150/javascript/sentenceWindow.js ::
showRestrictWindow :: line 146"  data: no]
This happens on Windows 98 and XP, but does not happen if the client is on
RedHat 7.2. (Same behavior in Netscape 7)

To see the bug, go to http://www.reengineeringllc.com
1. click Internet Business Logic
2. in the login page, click on GO
3. Double click "Choose an Agent and Go To Its Question Menu" then click
anywhere els in the page
4. Click on "Administator allows...."
5. In the resulting window, click "some-action"
6. In the resulting window, click "Choices menu"
7. In the resulting window, click "copy"
8. In the resulting window, click "some-item"
9. Nothing will happen, and the javascript console will show an uncaught exception.

Sorry the sequence is complex.  As mentioned, this works fine with Moz 1.0.1
client on Red Hat 7.2.  But it consistently gives the exception with Moz 1.0.1 
client on Win 98 or Win XP.     adrianw@snet.net


Reproducible: Always

Steps to Reproduce:

To see the bug, go to http://www.reengineeringllc.com, and open the javascript
console window.
1. click Internet Business Logic
2. in the login page, click on GO
3. Double click "Choose an Agent and Go To Its Question Menu" then click
anywhere else in the page
4. Click on "Administator allows...."
5. In the resulting window, click "some-action"
6. In the resulting window, click "Choices menu"
7. In the resulting window, click "copy"
8. In the resulting wide window, click "some-item"
9. Nothing will happen, and the javascript console will show an uncaught exception.




Actual Results:  
Nothing will happen, and the javascript console will show an uncaught exception.

Sorry the sequence is complex.  As mentioned, this works fine with Moz 1.0.1
client on Red Hat 7.2.  But it consistently gives the exception with Moz 1.0.1 
client on Win 98 or Win XP.     adrianw@snet.net



Expected Results:  
Should have continued similarly to steps 5 and 6.  SHould not have caused an
exception, since the steps 5. and 6. worked OK.

A javascript workaround would be much appreciated pending a bug fix, since most
of our customers are on Windows clients.  Such a workaround would likely cover
over the same problem with Netscape 7 on Windows, until and unless they get
around to fixing the bug.

Since things are OK with Moz 1.0.1 on Linux, but not on Windows, perhaps some
simpler cases can be found that provoke the bug ?
Confirming report with Mozilla trunk binary 20021015xx on WinNT.
Error is [nsIDOMJSWindow.open] ---> reassigning to DOM Level 0.

The HTML of that last child window producing the error is

<head>
<style><!--  A { text-decoration:none }--></STYLE>
<title>&nbsp;Question</title>
<script src="https://66.134.31.150/javascript/sentenceWindow.js">
</script></head><body border=0 bgcolor="bfffff" onload="self.focus();">

<form method="post" NAME="sentenceWindow"
      action =" https://66.134.31.150/cgi-bin/IBL" >

<input type="hidden" name="i" value=0>
<input type="hidden" name="j" value="non_domain_question">
<input type="hidden" name="question"
       value="Administrator allows <!!>  copy  </!!> on <!!>some-item</!!>  ">
<input type="hidden"  name="limOp" VALUE="none">
<input type="hidden"  size=20 NAME="userVar" VALUE="none">

<br><br>
<center>Administrator allows <!!>  copy  </!!> on
<a href="javascript:showRestrictWindow(0,1)";><!!>some-item</!!></a>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i><font color="aa6666"><b>

<input type="button"        
       value="Ask"onClick="opener.document.forms[0].submit();self.close();">

</b></font></i></center></form></body>



The function that is called is showRestrictWindow(0,1),
from https://66.134.31.150/javascript/sentenceWindow.js: 


function showRestrictWindow(i,j) {
  var x = 0, y = 0;

  if (opener.formQuestion==0) {jf=1} else {jf=0};

  jj=100*j;

  {x = opener.screenX + 100 + jf*jj;
   y = opener.screenY + 100 + opener.formQuestion*50;}

  details='width=155,height=60,dependent=1,resizable=no,top='+y+
          ',screenY='+y+',left='+x+',screenX='+x;


  restrictWindow=window.open('../restrictWindow.html','restrictWindow',details);

  if (restrictWindow.opener == null) {domainWindow.opener = self}

  document.forms[0].elements[0].value=i;
  document.forms[0].elements[1].value=j;
  opener.document.forms[0].elements[0].value=i;
  opener.document.forms[0].elements[1].value=j;
}
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale
Summary: Error: uncaught exception: → Error: uncaught exception: [nsIDOMJSWindow.open]
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
I just encountered this bug with Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8b5) Gecko/20050922 Firefox/1.4 ID:2005092206

It happened at tweakers.net, on a page where you can enter your system specs.
This happens in the following way:
1. You click a javascript link to open a window.
2. You select something in the popup window, this way, some text gets entered in
a textbox in the parent window, and the popup is closed.
3. You repeat these steps a lot of times.

Now, everything went ok for a while, but after I repeated the process several
times, one time it just stopped working and threw the NS_ERROR_FAILURE.
Restarting Firefox enabled me to use the page again, but after a couple of
iterations trough the proces, I got the same error again.
(In reply to comment #3)
> Now, everything went ok for a while, but after I repeated the process several
> times, one time it just stopped working and threw the NS_ERROR_FAILURE.
> Restarting Firefox enabled me to use the page again, but after a couple of
> iterations trough the proces, I got the same error again.

See bug 309775.
this bug is still appears in firefox 1.5 RC2

this happens frequently after opening and closing a popup many times (ca. 30).

Fehler: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMJSWindow.open]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: http://192.168.5.9/working/evalswift/admin/content/survey/survey_detail.siteswift?ts=0.074422001132033949 :: postToPopup :: line 22"  data: no]

<script language="javascript" type="text/javascript">
	function postToPopup(url, popupname, formname, params) {
		//window.open('', popupname, 'width=650, height=700, scrollbars=yes, resizable=yes, menubar=yes');
		var win = window.open('', popupname, params);
		
		var oldtarget = document.forms[formname].target;
		var oldaction = document.forms[formname].action;
		
		document.forms[formname].target = popupname;
		document.forms[formname].action = url;
		document.forms[formname].submit();
		
		document.forms[formname].target = oldtarget;
		document.forms[formname].action = oldaction;
		win.focus();
		return false;
	}
</script>
I am also experiencing this bug in my code.  However, I have devised a workaround.  It seems that this exception is only thrown when you pass a relative URL to the window.open method.  So, my experimentation has shown that:

window.open("./new_popup.html","winName");

throws the exception, while:

window.open("http://hostname/webpath/new_popup.html","winName");

does not throw the exception.
Same problems under Fedora 3 with Java 1.5.0.07
Here is I think a quick way to duplicate the issue


------------
Create a HTML page with : 
----------------------------------------------------------------
<script language="Javascript">
     function newWindow() {
     	alert("test")
          window.open("about:cache","NewWindow","WIDTH=300,HEIGHT=200")
     }
</script>
<a href="#" onclick="newWindow()">Get Cache</a>
----------------------------------------------------------------

Step 2
Click on the Get Cache link


Step 3

run JavaScript:  you will get the Error 
Assignee: general → nobody
QA Contact: desale → general
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
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.