MATLAB Help Browser Detection

I would like to create some HTML documentation for a large MATLAB application, which will be displayed mainly in the MATLAB help browser, in any version of MATLAB from 11b. This will have some custom CSS (but nothing very complicated).

However, I would also like the same documentation to be displayed in other browsers. I really like Chrome and IE9 and 10, although support for other browsers would be welcome. I need documentation for

  • Look essentially the same in all browsers, including the MATLAB help browser, but
  • In several ways, they look different when they are presented in the MATLAB help browser - in particular, I want matlab: links to be displayed and displayed differently because they are not supported outside the MATLAB help browser.

Question 1: I ran into difficulties even with 1, because, despite the simplicity of my CSS, the MATLAB help browser seems unpredictable in the parts of CSS that it supports, and it seems to be very much in MATLAB versions. I assume that it is not documented at all. Does anyone have any experience / tips on using CSS in MATLAB's help browser?

Question 2: I was hoping I could automatically determine if the matlab: protocol supported in the view browser, but it seems to be looking at other StackOverflow answers, this is not possible, Given that I need to support Chrome, don’t even try to try the matlab: link and determine won't it work, as Chrome seems to be failing. Boo. So my next thought is to use JavaScript to detect the UserAgent of the browser. MATLAB 11b communicates itself as Mozilla4.0 with ICEbrowser , while 13a gives Mozilla4.0 with Trident6 . I'm not quite sure what it is. I assume that they are third-party Java browser components that behave like Mozilla, and MathWorks changed the component between 11b and 13a.

If I discover UserAgent and assume that anything containing ICEbrowser or Trident strings might be enough to distinguish MATLAB's help browser for most purposes? Obviously, I will have to constantly update UserAgent strings for post-13a releases.

Thanks for your suggestions!

+4
source share
2 answers

The capabilities of the MATLAB help browser vary greatly not only between different versions of MATLAB, but also between different operating systems and even between different architectures (the latest 64-bit versions often have a particularly bad browser).

We use a user agent to deliver MATLAB-specific web pages. Here is a list of some of them:

 R2010b/R2011b, 32bit, WinXP: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20060705 R2010b/R2011b, 32bit, Win7: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.8) Gecko/20060705 R2010b, 64bit, Win7: Mozilla/5.0 (Java 1.6.0_17; Windows 7 6.1 amd64; de_DE) ICEbrowser/v6_0_2 R2011b, 64bit, Win7: Mozilla/5.0 (Java 1.6.0_17; Windows 7 6.1 amd64; de_DE) ICEbrowser/v6_0_2 R2012a, 32bit, Win7: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko R2012a, 32bit, WinXP: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko R2012a, 64bit, Win7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0) R2012b, 32bit, Win7: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko R2012b, 64bit, Win7: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; Tablet PC 2.0) R2010b, 32bit, Linux: Mozilla/5.0 (Java 1.6.0_17; Linux 2.6.32-33-generic i386; en_US) ICEbrowser/v6_0_2 

Please note that you cannot just compare strings with them, as some parts of the strings vary depending on the client machine (for example, language code).

Also note that other features besides rendering HTML and CSS are very different. In particular, support for JavaScript and HTTP authentication.

+3
source

icebrowser is a html java renderer that supports a random subset of html / javascript. Since 2012, for basic assistance and since 2013 for the help of "additional software", they switched to a client, which is a thin jni shell around its own browser, so you get a trident (= Internet Explorer) on the windows, webkit (= safari) on mac and gecko (= firefox) on linux. Unfortunately, they did not change the user agent to have something as obvious as matlab . This means that since 2013 we can use css / javascript rendering with real browser capability, but get all the cross-browser problems that you have on the open Internet. Until early 2013, browser capabilities were much more limited, but you only had to worry about one browser.

I was looking for a reliable way to determine if the Matlab protocol is supported: the protocol, but all I found is your question :-)

+2
source

Source: https://habr.com/ru/post/1479082/


All Articles