If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Print preview prevented by "file still loading" message using Javascript "newwin" object

RESOLVED DUPLICATE of bug 264476

Status

()

Firefox
Toolbars and Customization
RESOLVED DUPLICATE of bug 264476
11 years ago
11 years ago

People

(Reporter: Wayne, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6

I create "newwin" reports using Javascript functions. Mozilla refuses to preview a "newwin" report file for printing as it says the file is still loading. Menubar is loaded. Here is the basic code:
	var basics = window.open("", "newwin", "height=600,width=700,scrollbars,menubar,resizable,status");
Mozilla shows the file still loading with the wheel spinning on the menubar and the pointer with its still loading attachment, even when there is no more to load. Other browsers permit print preview, so there may be a bug. I sought help from WebDeveloper.Com but they could not help. Apparently there is no snippet of Javascript code to fix it.

Reproducible: Always

Steps to Reproduce:
1. I have extracted the start and end of the report, as there is a lot of code.
<html>
<head>
<script type="text/javascript">
<!--

     function showSummary(value) {

	var basics = window.open("", "newwin", "height=600,width=700,scrollbars,menubar,resizable,status");
	basics.document.write("<HTML>")
	basics.document.write("<TITLE>Here Are Your Results</TITLE>")
	basics.document.write("<BODY BGCOLOR='FFFFFF'>")
	basics.document.write("<p><center><h4><b><i>Full Version</b></i></h4></font></center>")
	basics.document.write("<p><center>Recent Date:- <b> Today </b>. Date of Birth:- <b> July 12, 1981 </b>. This report is for <b> Joe Brown </b>.</center>")
	basics.document.write("<p><center><i>Note:- </i>During changeover from one phase to the next the energy simply switches polarity. There are <b> 10000 </b> days between the two dates.</center>")

	basics.document.write("<br><center>Here one format fits all. For obvious reasons terms such as years, months, days, hours, minutes and seconds are written in the plural, even though the values might be singular.<br>...</center>")
	basics.document.write("</HTML>")
	}

// -->
</script>
</head>
<body>
<form><input type="button" name="reporting" value="Show Summary" onClick="showSummary(value)";></form>
</body>
</html>

2. Create html file

3. Run, then select Menu/Print Preview

Actual Results:  
A message alert says that "The browser cannot print preview right now. Please try again when the page has finished loading.

Expected Results:  
Displayed the Print Preview.

I tried the javascript:print.window() function, but the printer dialogue box remained hidden until "newwin" was closed and then there was nothing to print. So it is important that the bug be fixed if indeed it is a bug.
(Reporter)

Comment 1

11 years ago
I just successfully tested the modified yet basic script on MSIE 6 without any problems. However, Netscape 7.1 presented the same alert message.
You've found another way to trigger bug 264476 - rather than failing to execute basics.document.close() by causing an error first, the way that testcase did, you just skip calling it, so the load never ends.

*** This bug has been marked as a duplicate of 264476 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.