Merge pull request #7548 from Rob--W/window-print-avoid-microtask
Avoid window.print in a microtask
This commit is contained in:
commit
ef45085f10
@ -76,8 +76,16 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
renderProgress();
|
renderProgress();
|
||||||
print.call(window);
|
// Push window.print in the macrotask queue to avoid being affected by
|
||||||
setTimeout(abort, 20); // Tidy-up
|
// the deprecation of running print() code in a microtask, see
|
||||||
|
// https://github.com/mozilla/pdf.js/issues/7547.
|
||||||
|
setTimeout(function() {
|
||||||
|
if (!canvases) {
|
||||||
|
return; // Print task cancelled by user.
|
||||||
|
}
|
||||||
|
print.call(window);
|
||||||
|
setTimeout(abort, 20); // Tidy-up
|
||||||
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user