Closed Bug 1725311 Opened 3 years ago Closed 3 years ago

Can't print using window.print() the fist time after booting FireFox when print.tab_modal.enabled is false

Categories

(Core :: Printing: Output, defect)

Firefox 91
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: matsumiya, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

Steps to reproduce:

  1. Set print.tab_modal.enabled to false.
  2. Boot FireFox.
  3. Open print dialog with JavaScript like below.

var window_obj = window.open("","_blank",opt);
var document_obj = window_obj.document;
document_obj.open();
document_obj.write(html);
document_obj.close();
window_obj.focus();
window_obj.print();
window_obj.close();

  1. Click print button.

Actual results:

The page is not printed (print spool file is not created), and print dialog closes.
The page is printed fine the next time and on.

Expected results:

The page is printed.

The Bugbug bot thinks this bug should belong to the 'Core::Printing: Output' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Printing: Output
Product: Firefox → Core

I can't reproduce this. I can immediately initiate printing via the system dialog using that method. Can you check if there any errors in the browser console (Ctrl+Shift+J)

Flags: needinfo?(matsumiya)

Thanks for checking. I get following errors and similar lines when I click the print button. Printing is initiated, but it's not printed after clicking the last print button.

NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDocShell.domWindow] 4 browsing-context.js:413
get window resource://devtools/server/actors/targets/browsing-context.js:413
_getWindowForBrowserConsole resource://devtools/server/actors/webconsole.js:273
get global resource://devtools/server/actors/webconsole.js:256
makeDebuggeeValue resource://devtools/server/actors/webconsole.js:496
arguments resource://devtools/server/actors/webconsole.js:2079
map self-hosted:221
prepareConsoleMessageForRemote resource://devtools/server/actors/webconsole.js:2078
onConsoleAPICall resource://devtools/server/actors/webconsole.js:1795
onConsoleAPICall self-hosted:1175
contentProcessListener resource://devtools/server/actors/webconsole.js:757
receiveMessage resource://devtools/server/actors/webconsole/listeners/content-process.js:34

Exception { name: "NS_ERROR_NOT_AVAILABLE", message: "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDocShell.domWindow]", result: 2147746065, filename: "resource://devtools/server/actors/targets/browsing-context.js", lineNumber: 413, columnNumber: 0, data: null, stack: "get window@resource://devtools/server/actors/targets/browsing-context.js:413:5\n_windowReady@resource://devtools/server/actors/targets/browsing-context.js:1391:24\nwatch@resource://devtools/server/actors/targets/browsing-context.js:1666:25\n_onDocShellCreated/<@resource://devtools/server/actors/targets/browsing-context.js:862:32\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:103:22\n", location: XPCWrappedNative_NoHelper }

columnNumber: 0

data: null

filename: "resource://devtools/server/actors/targets/browsing-context.js"

lineNumber: 413

location: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: Getter, name: Getter, … }

message: "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIDocShell.domWindow]"

name: "NS_ERROR_NOT_AVAILABLE"

result: 2147746065

stack: "get window@resource://devtools/server/actors/targets/browsing-context.js:413:5\n_windowReady@resource://devtools/server/actors/targets/browsing-context.js:1391:24\nwatch@resource://devtools/server/actors/targets/browsing-context.js:1666:25\n_onDocShellCreated/<@resource://devtools/server/actors/targets/browsing-context.js:862:32\nexports.makeInfallible/<@resource://devtools/shared/ThreadSafeDevToolsUtils.js:103:22\n"

<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
ThreadSafeDevToolsUtils.js:82:13
reportException resource://devtools/shared/ThreadSafeDevToolsUtils.js:82
makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:109

Flags: needinfo?(matsumiya)
See Also: → 1719476

I think this is similar to below issue. print() doesn't block the first time and close() is executed before the print dialog opens.

https://stackoverflow.com/questions/66088178/printing-in-new-window-in-firefox-doesnt-work-the-first-time-but-afterwards

(In reply to Kenta Matsumiya from comment #0)

Steps to reproduce:

  1. Set print.tab_modal.enabled to false.

Given this part of the STR (also in the bug summary), this is probably no longer reproducible now that this pref has been removed (in bug 1702501).

Closing as WORSKFORME with a dependency on that bug ("worksforme" in the sense that it's not exactly "fixed" but presumably no longer testable/reproducible). Kenta, if you happen to still be able to reproduce somehow, please reopen and let us know the updated steps -- thanks!

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