Closed Bug 180114 Opened 22 years ago Closed 22 years ago

The Function "javascript:window.print();window.close()" dosn't work

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 172921

People

(Reporter: w.lewe, Unassigned)

References

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.1) Gecko/20020826 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.1) Gecko/20020826 At some web pages Popup-Windows can be opened to print the content. In this Popup-windows often is Button with the following code: <a href="javascript:window.print();window.close()">Print & Close</a><br> The Browser must print the content in the Popup window and close it. The Mozilla-Browser only closes the window but don't print the Content! Reproducible: Always Steps to Reproduce: 1. Create an HTML-File with the following content: <html><head><body> This is an error test page.<br> <a href="javascript:window.print();window.close()">Print & Close</a><br> </body></html> 2. Open the page with the mozilla Browser and click on "Print & Close". 3. The Windows-Printing Dialog is shown. Click Ok to print. Actual Results: The Window closes, but the printer isn't printing. Expected Results: Print the page and close the window.
Strang, for me your test prints the window, but does not close it (2002111308, win95)
to DOM0... is .print() supposed to be synchronous? I thought it was async?
Assignee: asa → jst
Status: UNCONFIRMED → NEW
Component: Browser-General → DOM Level 0
Ever confirmed: true
OS: Windows 2000 → All
QA Contact: asa → desale
Hardware: PC → All
The test case is too simple, window.close will not close the window if it is not opened with window.open. By creating the test window with window.open, the new window will close, but not print. It also hangs the browser :-( I hope to get time to attach a testcase later.
This is a known issue and possibly a dup.
Related (probably a dupe) to bug 172921.
*** Bug 183436 has been marked as a duplicate of this bug. ***
This bug persists in Mozilla 1.2.1 on Windows. Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2.1) Gecko/20021130 v1.0 used to work fine.
Mass-reassigning bugs to dom_bugs@netscape.com
Assignee: jst → dom_bugs
Bug also persists in Mozilla 1.4 (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624). Observed on a BBC web site which opens a pop-up window displaying radio listings suitable for print-out. The page performs "window.print();window.close();" in the onLoad event of body.
*** This bug has been marked as a duplicate of 17291 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
oops, wrong bug number
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
*** This bug has been marked as a duplicate of 172921 ***
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.