nw.js icon indicating copy to clipboard operation
nw.js copied to clipboard

onBeforeRequest blocks printing

Open mkazlauskas opened this issue 7 years ago • 2 comments

NWJS Version : tested with 0.26.6, 0.27.5, 0.28.0 Operating System : tested with Windows ia32 and Linux x64

Expected behavior

Calling nw.Window.print({}) or window.print() should render print preview and allow you to print.

Actual behavior

Print preview isn't rendered (Loading preview ...) and can't proceed to printing.

<!- What actually happens? ->

Not sure, either onBeforeRequest shouldn't affect printing or it should at least work when using it.

How to reproduce

Run my demo app:

chrome.webRequest.onBeforeRequest.addListener(details => {
  return {cancel: false};
} , {urls: ["<all_urls>"]}, ['blocking']);
nw.Window.open('index.html', {}, win => {
  win.print({});
});
<html>
<body>
  <p>print me</p>
</body>
</html>

Then comment out the webRequest listener and try to run again.

mkazlauskas avatar Feb 02 '18 16:02 mkazlauskas

Was able to reproduce. following above instructions in NW.js 0.28.0-sdk on Win 10 64-Bit.

TheJaredWilcurt avatar Feb 05 '18 17:02 TheJaredWilcurt

I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.28.2

Christywl avatar Feb 08 '18 07:02 Christywl