Closed Bug 1747682 Opened 3 years ago Closed 3 years ago

window.print() followed by window.close() is not waiting for print to finish (again)

Categories

(Core :: Printing: Output, defect, P3)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: jwatt, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 1662975 intended to fix:

newWin=window.open();
newWin.focus();
newWin.print();
newWin.close();

to wait until the print had completed. But it seems broken (again?).

nsGlobalWindowOuter waits for bc->IsDiscarded()==true:

https://searchfox.org/mozilla-central/rev/829f90aa365a9d9ebfd51e3966cf9333826d7268/dom/base/nsGlobalWindowOuter.cpp#5417-5421,5435-5436

But that bc is discarded shortly after the tab modal door hanger is opened.

Works here? I don't see the tab being closed instantaneously when I run that on the console, what am I missing?

Flags: needinfo?(jwatt)

(We have tests for this fwiw, so I'm curious about how are you reproducing this)

This repro's for me in Firefox 95 on Fedora.

Flags: needinfo?(jwatt)
Attachment #9257284 - Attachment mime type: text/plain → text/html

Well, that's a slightly different test-case as the window you're trying to print is the initial about:blank (Chrome seems to try to print about:blank there)

Bah, indeed. Sorry for the wasted time. :-/

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: