Commit 6d5378a6 authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1789439 - Throw rather than logging an error when tab-modal print is...

Bug 1789439 - Throw rather than logging an error when tab-modal print is already open. r=mstriemer a=pascalc

If we succeed but return null, we end up retargeting to a new window
here:

  https://searchfox.org/mozilla-central/rev/3aaca0a12a2d1463da54933bdbdae2f06fead06f/dom/ipc/ContentParent.cpp#5462-5465

Which is bad.

Depends on D156682

Differential Revision: https://phabricator.services.mozilla.com/D156683
parent 7b585bae
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -194,8 +194,7 @@ var PrintUtils = {
      // XXX This can be racy can't it? getPreviewBrowser looks at browser that
      // we set up after opening the dialog. But I guess worst case we just
      // open two dialogs so...
      Cu.reportError("Tab-modal print UI already open");
      return null;
      throw new Error("Tab-modal print UI already open");
    }

    // Create the print preview dialog.