class %CSP.UserAgent extends %RegisteredObject

Determine browser parameters from HTTP_USER_AGENT CGI variable.


Parameters Properties Methods Queries Indices ForeignKeys Triggers
5 2


Browser Platform SupportsXMLHttpRequest UserAgent
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OnNew %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject XMLHttpRequest


property Browser as %String;
Browser name
property Platform as %String;
Browser platform
property SupportsXMLHttpRequest as %Boolean;
Supports XMLHttpRequest.
property UserAgent as %String;
User agent for this class.
property Version as %String;
Browser version


method %OnNew(userAgent As %String) as %Status
Initialize with HTTP_USER_AGENT.
classmethod XMLHttpRequest(userAgent As %String, ByRef browser As %String, ByRef platform As %String, ByRef version As %String) as %Boolean
XMLHttpRequest returns true if XMLHttpRequest object is supported by the browser indicated by the userAgent. Current implementation parses User Agents beginning with:
Copyright © 1997-2020 InterSystems Corporation, Cambridge, MA
Mozilla/4.0 (compatible; MSIE
Mozilla/5.0 (compatible; MSIE
Browser type is IE. The major version must be greater than 5.0. The platform must be Windows.
Opera/ Browser type is Opera. The version must be greater than or equal to 7.60.
Mozilla/5.0 ( If the User Agent contains "Safari/", the browser type is Safari. The version number must be greater 119.0.

Otherwise the platform type must be one of Windows, Macintosh, or X11 and the User Agent must contain "Gecko/".

If User Agent also contains "Netscape/", the browser type is Netscape and the version must be greater than 7.0.

Otherwise User Agent must contain "rv:". The browser type is Mozilla and the version must be greater than 1.3. Camino version 5-- plus browsers listed in exclude-list are not supported.