title: How to override standard browser print and print an iframe by default
body: <p>I have a documentation type page with an iframe inside. I'm trying to override standard browser print (Ctrl + p) to print contents of an iframe only.</p>
  
  <p>I know how to print an iframe content using javascript:</p>
  
  <pre><code>window.frames['webcontent'].focus();
  window.frames['webcontent'].print();
  </code></pre>
  
  <p>I know how to do run javascript before printing e.g. as described here: <a href="https://stackoverflow.com/questions/3619609/check-for-when-a-user-has-selected-to-print-using-javascript">Check for when a user has selected to print using javascript</a> </p>
  
  <p>Any advise?</p>
  
  <p>Thanks</p>