Name

global.PPMDeviceHelper

Description

No description available

Script

var PPMDeviceHelper = Class.create();
PPMDeviceHelper.isMobileDevice = function() {
  
  var ua = gs.getSession().getProperty("user_agent_all").toLowerCase();
  var mobilePhones = ['android_phone','iphone'];
  
  for (var i = 0; i < mobilePhones.length ; i++){
  	if(ua.indexOf(mobilePhones[i]) > -1)
  		return true;
  }
  return false;
};

PPMDeviceHelper.isTabletDevice = function() {
  
  var ua = gs.getSession().getProperty("user_agent_all").toLowerCase();
  var tablets = ['ipad','android_tablet' ];
  
  for (var i = 0; i < tablets.length ; i++){
  	if(ua.indexOf(tablets[i]) > -1)
  		return true;
  }
  return false;
};

PPMDeviceHelper.isMac = function() {
  var ua = gs.getSession().getProperty("user_agent_all").toLowerCase();
  if(ua.indexOf('macintosh') > -1)
  	return true;
  
  return false;
};

Sys ID

e778e7e3533123007f60ddeeff7b12a8

Offical Documentation

Official Docs: