Bug 1852754: part 9) Add tests for dynamically loading <link rel="prefetch"> elements...
[gecko.git] / toolkit / actors / PrintingSelectionChild.sys.mjs
blobc8dfe3944930b0010352fd9a6f8e970f329aca92
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 export class PrintingSelectionChild extends JSWindowActorChild {
7   receiveMessage(message) {
8     switch (message.name) {
9       case "PrintingSelection:HasSelection":
10         return this.hasSelection();
11     }
13     return undefined;
14   }
16   hasSelection() {
17     let selection = this.browsingContext.associatedWindow?.getSelection();
18     return selection && selection.type == "Range";
19   }