Helper JavaScript

Small functions that help GSD.

Function Purpose Usage ACE Core
Detect Browser Returns an object with the name and version details of the user's browser. Note this should only be used in cases where feature detection is not sufficient, or in cases where content or behaviour must always and permanently vary between operating systems. An example use case is providing per-browser instructions on how to save files or configure the browser.

Call:

ACE.detectBrowser()

Example result:


                                                                    { 
                                                                      name: "chrome", 
                                                                      version: "51.0.2704.103", 
                                                                      majorVersion: "51", 
                                                                      minorVersion: "0", 
                                                                      patchVersion: "2704"
                                                                    }
Yes
Detect Operating System Returns a string identifying the operating system. Should only be used where content or behaviour must always and permanently vary between operating systems, for example keyboard shortcuts which are OS-specific.

Call:

ACE.detectOS()

Returns a string identifying the operating system, one of 'windows', 'mac', 'linux', 'android', 'ios' or 'windowsphone'. If the version is not detected, returns 'os-undetected'.

Yes
ACE Version Returns the version number of ACE. Useful if you have any code which needs to support more than one version of ACE.
ACE.version()
Yes