title: Feature detection solution for window.print() JavaScript
body: <h2>Question</h2>
  
  <p>Is there any way to detect support for window.print()?  I'd prefer to detect the feature itself vs trying to go down the rabbit hole of detecting whether I'm on a mobile browser or desktop or iOS or Android or which particular mobile browser I might be on.</p>
  
  <h2>Background</h2>
  
  <p>The following links lead me to believe that:</p>
  
  <ul>
  <li>Apple requires all 3rd party browsers to use UIWebView</li>
  <li>UIWebView as used in non-Safari apps does nothing when you run window.print()</li>
  <li>Safari on iOS does something appropriate when you run window.print()</li>
  </ul>
  
  <p>The links:</p>
  
  <ul>
  <li><a href="https://productforums.google.com/forum/#!topic/chrome/7wTj1dteSeI" rel="nofollow noreferrer">https://productforums.google.com/forum/#!topic/chrome/7wTj1dteSeI</a></li>
  <li><a href="https://stackoverflow.com/q/20061383/749227">Javascript printing on mobile devices(ios)</a></li>
  <li><a href="https://stackoverflow.com/a/4362472/749227">https://stackoverflow.com/a/4362472/749227</a></li>
  <li><a href="http://daringfireball.net/linked/2012/06/28/chrome-ios" rel="nofollow noreferrer">http://daringfireball.net/linked/2012/06/28/chrome-ios</a></li>
  <li><a href="https://stackoverflow.com/a/4362472/749227">https://stackoverflow.com/a/4362472/749227</a></li>
  </ul>
  
  <p>P.S. I looked in the Modernizr docs to see if it can detect support for printing, but didn't spot anything.</p>
  
  <p>P.P.S. I see that Chrome for iOS does support printing, albeit through GCP.  Here, just looking for feature detection rather than a print solution.  (<a href="https://support.google.com/chrome/answer/3049815?hl=en&amp;ref_topic=1719889" rel="nofollow noreferrer">https://support.google.com/chrome/answer/3049815?hl=en&amp;ref_topic=1719889</a>)</p>
  
  <p><strong>Edit</strong>
  To clarify, it appears that window.print is not part of any standard: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window.print" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/Window.print</a>.  If window.print exists in some browsers but doesn't do anything useful (e.g., isn't wired up to any browser-specific implementation of appropriate printing functionality) that is ultimately what I want to detect.  </p>
  
  <p>My guess is that mobile browser vendors will have something defined for window.print so that any scripts that try to call it won't error; but the call may be a No op, or may send a request the the operating system that the OS simply ignores.  </p>
  
  <p>The more I think about how the guts of this could be working the less hopeful I am of a simple JavaScript approach to detecting the feature, which is too bad.</p>