Difference between revisions of "Jmol Applet/Browser Support"

From Jmol
Jump to navigation Jump to search
(Documenting browser support (JmolApplet and Jmol.js))
 
Line 12: Line 12:
  
 
"isBrowserCompliant" works basically in this way:
 
"isBrowserCompliant" works basically in this way:
* If 'document.getElementById' exists, then "isBrowserCompliant" passes.
+
* If "document.getElementById" exists, then "isBrowserCompliant" passes.
 
* Exceptions:
 
* Exceptions:
** Linux/Unix Konqueror 3.3 or below
+
** Linux/Unix Konqueror ≤3.3
** Mac Opera 7.54 or below
+
** Mac Opera ≤7.54
 
** Mac Internet Explorer
 
** Mac Internet Explorer
** Mac Safari 125.12 or below
+
** Mac Safari ≤1.2 (Webkit version ≤125.12)
 +
** Mac Mozilla with Java ≤1.4.2
  
 
Caveats:
 
Caveats:
* Detection is based on [[:en:Browser Sniffing|browser sniffing]], which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol.
+
* Detection is mostly based on [[:en:Browser Sniffing|browser sniffing]], which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol, and that was the best way to detect them.
 
* Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome)
 
* Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome)
  

Revision as of 20:27, 30 November 2010

Browser support for the Jmol applet using Jmol.js

This page tries to explain and document what the File icon.gifJmol.js javascript library is doing to insert applets depending on the user's browser. It will hoepfully lead to discussion about future implementation.

According to Jmol version 12.0.21.

File icon.gifJmol.js runs some tests to anticipate browser compatibility and to decide how to insert the Jmol applet in the pages.

Browser compatibility

The "isFullyCompliant" test includes both "isBrowserCompliant" and "isJavaCompliant".

"isJavaCompliant" just checks if "navigator.javaEnabled()" returns true or false.

"isBrowserCompliant" works basically in this way:

  • If "document.getElementById" exists, then "isBrowserCompliant" passes.
  • Exceptions:
    • Linux/Unix Konqueror ≤3.3
    • Mac Opera ≤7.54
    • Mac Internet Explorer
    • Mac Safari ≤1.2 (Webkit version ≤125.12)
    • Mac Mozilla with Java ≤1.4.2

Caveats:

  • Detection is mostly based on browser sniffing, which is in general terms a method not recommended to adapt web content to browsers. The rationale is probably that some specific browsers proved not to be compatible with Jmol, and that was the best way to detect them.
  • Some (recent) browsers are therefore not being taken care of. (e.g. Safari in Windows, Chrome)

HTML tag for the applet

The history of inserting Java applets in pages is long and complex, and there has been permanent debate over methods, standards and actual practice. Details will not be given here.

In summary, there are 3 ways an applet can be inserted into an html page:

  1. Use an <applet> tag.
  2. Use an <object> tag adequate for MS Internet Explorer.
  3. Use an <object> tag adequate for other browsers.

Contributors

AngelHerraez