title: How to detect iPad Pro as iPad using javascript?
body: <p>We were able to detect an iPad device using javascript like this:</p>
  
  <pre><code>function isDeviceiPad(){
      return navigator.platform.match(/iPad/i);
  }
  </code></pre>
  
  <p>That worked perfectly in detecting iPad devices, but when we checked from an <code>iPad Pro (10.5 inch)</code>, it does not detect that it is an iPad.</p>
  
  <p>To further investigate, we drilled down into the <code>navigator</code> object,  checked both <code>platform</code> and <code>userAgent</code>, and got these results:</p>
  
  <pre><code>navigator.platform = 'MacIntel';
  navigator.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) 
   AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15)';
  </code></pre>
  
  <p>The issue is that <code>navigator.platform = 'MacIntel'</code> (which is the same as the MacBook Pro) is returned instead of the <code>iPad</code>. We need a way to detect that this is an iPad and not a MacBook Pro, but it seems that the navigator does not return <code>iPad</code> like it does with older iPads.</p>
  
  <p>Any idea how we can fix this issue?</p>