Author: marcus
Date: Mon Jun 9 20:47:50 2014
New Revision: 1601507
URL: http://svn.apache.org/r1601507
Log:
Fixed error: Do not abort when 'navigator.vendor' has empty or undefined
content, seems to be a problem with Windows 8 and its MS IE 10
Modified:
openoffice/ooo-site/trunk/content/download/test/download.js
Modified: openoffice/ooo-site/trunk/content/download/test/download.js
URL:
http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download.js?rev=1601507&r1=1601506&r2=1601507&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Mon Jun 9
20:47:50 2014
@@ -788,10 +788,15 @@ function getLinkSel() {
function getPlatform() {
// For more help or data see: "http://www.useragentstring.com".
- var av = navigator.appVersion.toLowerCase(); // Get
the application version in lower case.
- var os = navigator.platform.toLowerCase(); // Get
the platform string in lower case.
- var ua = navigator.userAgent.toLowerCase(); // Get
the user agent string in lower case.
- var ve = navigator.vendor.toLowerCase(); // Get
the vendor string in lower case.
+ if( navigator.appVersion )
+ var av = navigator.appVersion.toLowerCase(); // Get
the application version in lower case.
+ if( navigator.platform )
+ var os = navigator.platform.toLowerCase(); // Get
the platform string in lower case.
+ if( navigator.userAgent )
+ var ua = navigator.userAgent.toLowerCase(); // Get
the user agent string in lower case.
+ if( navigator.vendor )
+ var ve = navigator.vendor.toLowerCase(); // Get
the vendor string in lower case.
+
UI_PLATFORM = ""; //
Delete previously set string.
UI_PLATFORM_NO_SUP = ""; //
Delete previously set string.
PLATFORM = ""; //
Delete previously set string.
@@ -820,10 +825,14 @@ function getPlatform() {
// Recognized but *not supported* platforms/OS, set
$UI_PLATFORM_NO_SUP to show it to the user.
// Mobile devices.
+ if( ve )
+ if( ua.indexOf( "android" ) !== -1 )
+ if( ua.indexOf( "nexus" ) !== -1 &&
+ ve.indexOf( "google" ) !== -1 )
UI_PLATFORM_NO_SUP = "Google Nexus";
+
if( ua.indexOf( "android" ) !== -1 )
- if( ua.indexOf( "nexus" ) !== -1 &&
- ve.indexOf( "google" ) !== -1 )
UI_PLATFORM_NO_SUP = "Google Nexus";
- else if( ua.indexOf( "moble" ) !== -1 )
UI_PLATFORM_NO_SUP = "Mobile Devices (Android)";
+ if( ua.indexOf( "mobile" ) !== -1 )
UI_PLATFORM_NO_SUP = "Mobile Devices (Android)";
+
if( os.indexOf( "arm" ) !== -1 )
UI_PLATFORM_NO_SUP = "Mobile Devices (ARM processor)";
if( ua.indexOf( "blackberry" ) !== -1 )
UI_PLATFORM_NO_SUP = "Blackberry Smartphones";
if( ua.indexOf( "brew" ) !== -1 )
UI_PLATFORM_NO_SUP = "Smartphones (BREW)";