System.Windows.Forms.WebBrowser

在前端寫 JavaScript code 辨別。

    //alert( window.navigator.appName );  // Edge, 11 -> "Netscape"==appName
    engine = null;
    if ( window.navigator.appName == "Microsoft Internet Explorer" || window.navigator.appName == "Netscape" )
    {
       // This is an IE browser. What mode is the engine in?
       if ( document.documentMode ) // IE8 or later
       {
          engine = document.documentMode;
       }
       else // IE 5-7
       {
          engine = 5; // Assume quirks mode unless proven otherwise
          if ( document.compatMode )
          {
             if ( document.compatMode == "CSS1Compat" )
                engine = 7; // standards mode
          }
          // There is no test for IE6 standards mode because that mode  
          // was replaced by IE7 standards mode; there is no emulation.
       }
       // the engine variable now contains the document compatibility mode.
       //alert( engine );  // 10, 9, 8, ...
    }

參考來源:Internet

 

arrow
arrow

    Robert 發表在 痞客邦 留言(0) 人氣()