title: Detect MATLAB Help Browser
body: <p>I'd like to create some HTML documentation for a large MATLAB application, to be viewed mainly within the MATLAB Help Browser, in any version of MATLAB from 11b on. This would have some custom CSS (but nothing very complicated).</p>
  
  <p>However, I'd also like the same documentation to be viewable within other browsers. I care about Chrome and IE9 and 10, although support for other browsers would be welcome. I'd like the documentation to  </p>
  
  <ol>
  <li>Look essentially the same across all the browsers including the MATLAB Help Browser, but </li>
  <li>In a few ways look different when presented in the MATLAB Help Browser - in particular, I want <code>matlab:</code> links to be displayed and behave differently, as they are not supported outside the MATLAB Help Browser.</li>
  </ol>
  
  <p><strong>Question 1:</strong> I'm running into difficulty even with 1, as despite the simplicity of my CSS the MATLAB Help Browser seems unpredictable in what parts of CSS it supports, and it seems to vary a great deal across MATLAB versions. I'm guessing that it's not documented at all. Does anyone have any experience/tips about using CSS in the MATLAB Help Browser?</p>
  
  <p><strong>Question 2:</strong> I was hoping to be able to auto-detect somehow whether the <code>matlab:</code> protocol was supported in the viewing browser, but it seems from browsing other StackOverflow answers that this is not possible. Given that I need to support Chrome, it's not even possible to try following a <code>matlab:</code> link and detect if it fails, as apparently Chrome fails silently. Boo. So my next thought is to use JavaScript to detect the UserAgent of the browser. MATLAB 11b reports itself as Mozilla4.0 with <code>ICEbrowser</code>, whereas 13a gives Mozilla4.0 with <code>Trident6</code>. I'm not entirely sure what these are - I'm guessing they're third-party Java-based browser components that behave like Mozilla, and MathWorks have changed the component between 11b and 13a.</p>
  
  <p>If I detect the UserAgent and assume that anything containing the strings <code>ICEBrowser</code> or <code>Trident</code>, is that likely to be sufficient to distinguish the MATLAB Help Browser for most purposes? Obviously I'll have to keep up to date with UserAgent strings for post-13a releases.</p>
  
  <p>Thanks for your suggestions!</p>