`
sillycat
  • 浏览: 2492399 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Getting Browsers Information from JS Object

    博客分类:
  • UI
阅读更多
Getting Browsers Information from JS Object

First of all, I prepare my system and my mobile phone.

System is ubuntu desktop. So I install opera, Firefox, chrome, Midori.

Mobile phone is G7, so I install go, opera mini, uc, mathon and G7 internet browser.
Actually, only 2 of the browsers on G7 can access local web server: mathon and G7 internet browser.

My html page navigator.html:
<html>
<head>
  <title>JavaScript Master-Navigator</title>
  <script type="text/javascript">
  function write2HTML(name,value){
  document.write("<p>" + name + ": ");
  document.write(value + "</p>");
  }

  var x = navigator;
 
  document.write("<h1>JavaScript Navigator</h1>");

  write2HTML("AppName",x.appName); 

  write2HTML("Vendor",x.vendor); 

  write2HTML("VendorSub",x.vendorSub);

  write2HTML("App Version",x.appVersion);

  //for example: Mozilla
  write2HTML("App Code Name",x.appCodeName);

  write2HTML("cookieEnabled",x.cookieEnabled);

  write2HTML("userAgent",x.userAgent); 

  //additional version messages
  write2HTML("appMinorVersion",x.appMinorVersion); 

  write2HTML("browserLanguage",x.browserLanguage); 

  write2HTML("language",x.language); 

  write2HTML("systemLanguage",x.systemLanguage); 

  write2HTML("userLanguage",x.userLanguage); 

  write2HTML("cpuClass",x.cpuClass); 

  write2HTML("oscpu",x.oscpu); 

  write2HTML("javaEnabled",x.javaEnabled());
 
  //the browser is or not online to internet
  write2HTML("onLine",x.onLine); 

  //platform
  write2HTML("platform",x.platform); 

  //mime types which registered on the device
  //MimeType description/type/enabledPlugin/suffixes
  //DOMPlugin description/filename/length(The quantity of plug in associated MimeType objects)/name
  document.write("<p>MimeTypes: ");
  for(var i = 0;i<x.mimeTypes.length;i=i+1){
  document.write(x.mimeTypes[i].enabledPlugin.name + ",");
  if(i == 5){
  break;
  }
  }
  document.write("</p>");
 
  //plugins on the device
  //DOMPluginArray
  //DOMPlugin description/filename/length(The quantity of plug in associated MimeType objects)/name
  document.write("<p>Plugins: ");
  for(var i = 0;i<x.plugins.length;i=i+1){
  document.write(x.plugins[i].name);
  if(i == 5){
  break;
  }
  }
  document.write("</p>");
 
  //preference
  write2HTML("Preference",x.preference);   

  //product
  write2HTML("Product",x.product); 

  //productSub
  write2HTML("ProductSub",x.productSub); 

  //opsProfile
  write2HTML("OpsProfile",x.opsProfile); 

  //userProfile
  write2HTML("UserProfile",x.userProfile);
 
  //securityPolicy
  write2HTML("SecurityPolicy",x.securityPolicy); 
  </script>
</head>
<body>
</body>
</html>

my html page monitor.html:
<html>
<head>
  <title>JavaScript Master-Monitor</title>
  <script type="text/javascript">
 
  function write2HTML(name,value){
  document.write("<p>" + name + ": ");
  document.write(value + "</p>");
  }
 
  var s = screen;
 
  document.write("<h1>JavaScript Monitor</h1>");
 
  write2HTML("availHeight",s.availHeight);
 
  write2HTML("availWidth",s.availWidth);

  write2HTML("colorDepth",s.colorDepth);

  write2HTML("height",s.height);

  write2HTML("width",s.width);
  </script>
</head>
<body>
</body>
</html>

my html page location.html:
<html>
<head>
  <title>JavaScript Master-Navigator</title>
  <script type="text/javascript">
  function write2HTML(name,value){
  document.write("<p>" + name + ": ");
  document.write(value + "</p>");
  }

  var l = window.location;
  document.write("<h1>JavaScript Location</h1>");

  write2HTML("Hash",l.hash);

  write2HTML("Host",l.host);

  write2HTML("Hostname",l.hostname);

  write2HTML("Href",l.href);

  write2HTML("Pathname",l.pathname);

  write2HTML("Port",l.port);

  write2HTML("Protocol",l.protocol);

  write2HTML("Search",l.search);

  write2HTML("Target",l.target);

 
  </script>
</head>
<body>
</body>
</html>


references:
http://www.w3school.com.cn/js/js_browser.asp
http://www.comptechdoc.org/independent/web/cgi/javamanual/javamimetype.html
http://www.comptechdoc.org/independent/web/cgi/javamanual/javalocation.html
http://www.gootry.com/java-height/article/100819203028/246
http://www.gootry.com/java-height/article/100820212451/248
分享到:
评论

相关推荐

    Forget_the_Sandbox_Escape_Abusing_Browsers_from_Code_Executi

    Forget_the_Sandbox_Escape_Abusing_Browsers_from_Code_Execution 安全运营 业务风控 安全架构 漏洞挖掘 渗透测试

    「数据库审计」Forget_the_Sandbox_Escape_Abusing_Browsers_from_Code_E

    「数据库审计」Forget_the_Sandbox_Escape_Abusing_Browsers_from_Code_Execution - 技术分析 渗透测试 WEB应用防火墙 法律法规 安全知识 WAF

    Getting Started with Grunt: The JavaScript Task Runner

    Getting Started with Grunt: The JavaScript Task Runner provides you with all the information you need to become an effective Grunt power-user. You will quickly learn how to install, configure, and run...

    Web Browsers

    Web Browsers, A web browser is the software program you use to access the World Wide Web, the graphical portion of the Internet. The first browser, called NCSA Mosaic, was developed at the National ...

    App_Browsers for ie11

    解决asp.net部分服务器控件在ie11下不能使用问题,下载后直接将解压后的App_Browsers文件下放到项目根目录下即可。

    Getting started with WebAssembly & Emscripten-March 5, 2019.z01

    WebAssembly is the most promising new technology for the web, allowing browsers, and other JavaScript environments, to run blazing-fast raw binary modules, compiled directly from C, C++ and many other...

    Getting started with WebAssembly & Emscripten-March 5, 2019.z02

    WebAssembly is the most promising new technology for the web, allowing browsers, and other JavaScript environments, to run blazing-fast raw binary modules, compiled directly from C, C++ and many other...

    Getting started with WebAssembly & Emscripten-March 5, 2019.zip-共3分卷

    WebAssembly is the most promising new technology for the web, allowing browsers, and other JavaScript environments, to run blazing-fast raw binary modules, compiled directly from C, C++ and many other...

    Getting Started with Grunt(PACKT,2014)

    Getting Started with Grunt: The JavaScript Task Runner provides you with all the information you need to become an effective Grunt power-user. You will quickly learn how to install, configure, and ...

    App_Browsers

    解决IE10中 _doPostBack() 的bug 将App_Browsers直接放到IIS的发布网站下

    How browsers work

    Behind the scenes of modern web browsers

    Learning.Underscore.js.178439381

    Prepare for the upcoming JavaScript standard ECMAScript 6 and support older browsers In Detail Underscore.js is one of the most popular modern JavaScript libraries used for functional programming. It ...

    Professional JavaScript for Web Developers英文版

    fly graphicsJavaScript API changes in HTML5how browsers handle JavaScript errors and error handlingfeatures of JavaScript used to read and manipulate XML datathe JSON data format as an alternative to ...

    JSON2.JS JSON.JS JSON_PARSE.JS

    json2.js: This file creates a JSON property in the global object, if there isn't already one, setting its value to an object containing a stringify method and a parse method. The parse method uses ...

    JavaScript权威指南

    Using JavaScript from Java Section 22.3. Using Java Classes Directly Section 22.4. LiveConnect Data Types Section 22.5. LiveConnect Data Conversion Section 22.6. JavaScript Conversion of ...

    json3.js开发板和生产版本

    JSON.parse(jsonstr); 对JSON字符串反序列化成JSON对象;JSON.stringify(jsonobj); 将JSON对象序列化成JSON字符串,传到后台再进行反序列化, 官方地址 ...相对json.js与json2.js json3.js做了很多优化,建议使用

    browser.js + browser.min.js

    Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments.

    App_Browsers.rar

    解决.net中web系统页面无法跳转,重定向失败问题,将此文件夹解压后放到项目文件夹中即可解决,亲测可用

    JavaScript圣经第六版-英文版

    Updated to include the latest coverage of JavaScript, including howit fits into current Web browsers and applications as well as an exploration of its interaction with XML data in Ajax - This mammoth ...

Global site tag (gtag.js) - Google Analytics