nw.js
nw.js copied to clipboard
onBeforeRequest blocks printing
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.
Was able to reproduce. following above instructions in NW.js 0.28.0-sdk on Win 10 64-Bit.
I can reproduce this issue on Linux/Windows with nwjs-sdk-v0.28.2