On a webpage, I have a simple script to refresh the page when the browser resizes to force an embedded Tableau file to resize correctly:
window.addEventListener('resize', function () {"use strict"; window.location.reload();})
I'm running into a problem using this script when the user tries to print the page using the browser's print button - the page reloads, and cancels the printing. How can I force the reload/resize event without affecting the print functionality?