0

I've had code on my website for some time now that when a certain option is selected from the select control on a form it calls the window.print() method on the page. It pops up the print preview dialog, and when either print or cancel is clicked, the Aw Snap error ends up being displayed in the page. In testing sometimes it will work the first time you try it, but generates the error upon subsequent selections. Here is an example:

<select id="testselect" onchange="window.print();">
  <option value="1">Option 1</option>
  <option value="2">Option 2</option>
</select>

This example worked fine when I was on chrome 78.xxx, but upon updating to the latest version 79.0.3945.88, I get the Aw Snap error.

I'm guessing that this is a chrome bug, but any ideas for a work around would be greatly appreciated.

isherwood
  • 58,414
  • 16
  • 114
  • 157
Mike T.
  • 61
  • 6
  • Does the page contain an iframe? –  Jan 02 '20 at 21:59
  • Does this question help? https://stackoverflow.com/questions/18240001/print-function-in-chrome-no-longer-working –  Jan 02 '20 at 21:59
  • What's the actual error? The happy little message that shows up in the browser isn't really helpful. Anything in the console? – isherwood Jan 02 '20 at 22:04
  • @Amy - The page doesn't contain and iframe, and that other post isn't quite what I'm doing. I'm not trying to close a window, I'm just calling window.print in the onchange of a select control. It seems to only be an issue with calling it from onchange, because Ctrl-P works fine and if I attach it to the onclick of a button, there is also no issue. – Mike T. Jan 03 '20 at 13:36
  • @isherwood - I only get the the generic error Can't Open this page, and when I try to use developer tools to see if there are errors in the console, it says DevTools was disconnected from the page. Once page is reloaded, DevTools will automatically reconnect. So I'm at a loss on how to troubleshoot it. – Mike T. Jan 03 '20 at 13:39

0 Answers0