Skip to content

Commit

Permalink
update: clean code of printWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Oct 19, 2023
1 parent 39b6f59 commit 9426519
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions addon/chrome/content/printWrapper.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@
browser = PrintUtils.createBrowser();
document.body.appendChild(browser);
browser.contentWindow.location.href = args.url;
console.log("loading");
loaded = true;
await waitUtilAsync(() => {
console.log(browser, browser.contentWindow);
return browser.contentWindow?.document.readyState === "complete";
});
console.log("loaded");
await waitUtilAsync(
() => browser.contentWindow?.document.readyState === "complete",
);
args.browser = browser;
args._initPromise.resolve();
});
Expand All @@ -71,7 +68,7 @@
});
}
window.print = async () => {
scope.PrintUtils.startPrintWindow(browser.browsingContext);
PrintUtils.startPrintWindow(browser.browsingContext);
};
</script>
</head>
Expand Down

0 comments on commit 9426519

Please sign in to comment.