Chrome: window.print() print dialogue opens only after page reload (javascript) -
i facing weird problem. calling window.print() javascript file. working fine in safari, ie, firefox... , until 2 hours ago worked in chrome, too. (version 29.0.1547.57)
i did not change essential in javascript file (really - removed comments...), happens weird: in chrome, print dialogue not open when window.print() called. nothing happens. then, when press reload, print dialogue opens immediately.
the behaviour in other browser did not change. , while debugging in chrome can see window.print() called expected , script goes on after that. print dialogue not shown until pressing reload.
has ever experienced that? tried call window.print() in settimeout(), did not change anything. when debug content of page shall printed appears loaded.
i sorry ask, did not find while researching. appreciated!
thank you!
wasiim right, there chrome bug window.print() not work when there <video> tag in dom. solved calling function:
function printpage() { window.print(); //workaround chrome bug - https://code.google.com/p/chromium/issues/detail?id=141633 if (window.stop) { location.reload(); //triggering unload (e.g. reloading page) makes print dialog appear window.stop(); //immediately stop reloading } return false; }
Comments
Post a Comment