Spaces:
Sleeping
Sleeping
Commit ·
7faae3d
1
Parent(s): c51e028
adding a delay for window to popup on print
Browse files95 unmodified lines9697989910010110210310410510610730 unmodified lines13813914014114214395 unmodified linesvar pageContainer = document.getElementById('brewRenderer');if (pageContainer) {var printWindow = window.open('', 'Print Preview', 'height=800,width=600');// if (!printWindow) {// console.error('Failed to open print window.');// return;// }console.log('Page container content:', pageContainer.innerHTML); // Debugging lineprintWindow.document.write(`<!DOCTYPE html>30 unmodified lines</body></html>`);// Wait for the content to be fully loaded before printingprintWindow.onload = function() {95 unmodified lines9697989910010110210310410510610710810911011111230 unmodified lines14314414514614714814995 unmodified linesvar pageContainer = document.getElementById('brewRenderer');if (pageContainer) {var printWindow = window.open('', 'Print Preview', 'height=800,width=600');if (!printWindow) {console.error('Failed to open print window.');return;}// Introduce a small delay to allow the window to fully instantiatesetTimeout(function() {if (!printWindow || printWindow.closed || typeof printWindow.closed == 'undefined') {console.error('Failed to open print window.');return;}printWindow.document.write(`<!DOCTYPE html>30 unmodified lines</body></html>`);}, 100); // Delay of 100 milliseconds// Wait for the content to be fully loaded before printingprintWindow.onload = function() {
scripts.js+11-5