diff --git a/toolkit/actors/PrintingSelectionChild.jsm b/toolkit/actors/PrintingSelectionChild.jsm index 87d802dde508..b13ced53ad89 100644 --- a/toolkit/actors/PrintingSelectionChild.jsm +++ b/toolkit/actors/PrintingSelectionChild.jsm @@ -12,17 +12,19 @@ class PrintingSelectionChild extends JSWindowActorChild { receiveMessage(message) { switch (message.name) { case "PrintingSelection:HasSelection": - return this.hasSelection(this.document.ownerGlobal); + return this.hasSelection(); } return undefined; } - hasSelection(global) { - const { content } = global; + hasSelection() { + let focusedWindow = Services.focus.focusedWindow; + if (focusedWindow) { + let selection = focusedWindow.getSelection(); + return selection.type == "Range"; + } - let focusedWindow = Services.focus.focusedWindow || content; - let selection = focusedWindow.getSelection(); - return selection.type == "Range"; + return false; } } diff --git a/toolkit/components/printing/content/printUtils.js b/toolkit/components/printing/content/printUtils.js index d1675cbe9892..1bbfbc1562c7 100644 --- a/toolkit/components/printing/content/printUtils.js +++ b/toolkit/components/printing/content/printUtils.js @@ -235,8 +235,7 @@ var PrintUtils = { "PrintingSelection" ); hasSelection = await sourceActor.sendQuery( - "PrintingSelection:HasSelection", - {} + "PrintingSelection:HasSelection" ); }