In AskiaScript, the browser object is a predefined object that can be used to obtain information about the current respondent's browser identity, resolution and capabilities. This variable is in the global scope, so is available everywhere inside AskiaScript.
In this topic:
Indicates whether the browser is running on a mobile device.
Returns a Boolean.
Browser.Mobile ' => true
Returns the name of the browser.
Returns a String.
Browser.Name ' => "Internet Explorer"
Browser.Name ' => "Firefox"
Browser.Name ' => "Chrome"
Browser.Name ' => "" ' When unknown
Returns the short name of the operating system.
Returns a String.
Browser.OS ' => "Windows"
Browser.OS ' => "Mac"
Browser.OS ' => "" ' When unknown
Returns the available height, in pixels, of the rendering surface of the output device.
Returns a Number.
Browser.ScreenAvailHeight ' => 1040
Returns the available width, in pixels, of the rendering surface of the output device.
Returns a Number.
Browser.ScreenAvailWidth ' => 1920
Returns the number of bits allocated to colours (i.e. excluding the alpha channel) in the output device. If the output device does not support colours, then these attributes must return zero.
Returns a Number.
Browser.ScreenColorDepth ' => 32
Returns the height, in pixels, of the output device.
Returns a Number.
Browser.ScreenHeight ' => 1080
Returns the width, in pixels, of the output device.
Returns a Number.
Browser.ScreenWidth ' => 1920
Returns the user-agent of the browser.
Returns a String.
Browser.UserAgent ' => "Mozilla/5.0 (iPad; U;CPU OS 3_2_1 like Mac OS X; en-us)[...]" ' for Safari on iPad
Returns the major version number of the browser.
Returns a String.
Browser.Version ' => "8"
Browser.Version ' => "11.6"
Browser.Version.ToNumber() ' => 11.6
Browser.Version ' => "" ' When unknown
Returns the viewport height, in pixels, including the size of any rendered scroll bar (window.innerHeight).
Returns a Number.
Browser.WindowHeight' => 895
Returns the viewport width, in pixels, including the size of any rendered scroll bar (window.innerWidth).
Returns a Number.
Browser.WindowWidth' => 1916
Returns the version of the specified plugin.
Returns a String.
Browser.PluginVersion("Flash") ' => "11.2.202.235"
Browser.PluginVersion("Silverlight") ' => "4.1.10329.0"
Browser.PluginVersion("QuickTime") ' => ""
Indicates whether the browser can supports the specified feature.
Returns a Boolean.
' Suports Flash?
Browser.Support("flash") ' => true
' Supports Silverlight?
Browser.Support("silverlight") ' => false
' Supports touch events?
Browser.Support("touch") ' => true
' Supports cookies?
Browser.Support("cookies") ' => true
' Supports the HTML 5 video tag?
Browser.Support("video") ' => false
Returns a string which represents the current Browser object.
Returns a String.
Browser.ToString() ' => <Browser::123456> ' (TODO::Probably have to be improved or ' done differently like XML or JSON format)
Always returns "browser".
Returns a String.
Browser.TypeOf() ' => "browser"
The possible plugin keys are as follows.
| Key | Description | Example |
|---|---|---|
| Flash | Version of the Flash plugin, or an empty string when not installed. | "11.2.202.235" |
| QuickTime | Version of the QuickTime plugin, or an empty string when not installed. | "" |
| WindowsMediaPlayer | Version of the WindowMediaPlayer plugin, or an empty string when not installed. | "" |
| Silverlight | Version of the Silverlight plugin, or an empty string when not installed. | "4.1.10329.0" |
| VLC | Version of the VLC plugin, or an empty string when not installed. | "" |
| AdobeReader | Version the Adobe PDF Reader, or an empty string when not installed. | "10.1.3.0" |
| PDFReader | Version of other PDF reader, or an empty string when not installed. | "" |
| RealPlayer | Version of Real Player plugin, or an empty string when not installed. | "" |
The possible feature keys are as follows.
|
Key |
Description |
|---|---|
| Flash | Indicates whether the browser supports the Flash plugin |
| QuickTime | Indicates whether the browser supports the QuickTime plugin |
| WindowsMediaPlayer | Indicates whether the browser supports the Windows Media Player plugin |
| Silverlight | Indicates whether the browser supports the Silverlight plugin |
| VLC | Indicates whether the browser supports the VLC plugin |
| AdobeReader | Indicates whether the browser supports the Adobe PDF Reader plugin |
| PDFReader | Indicates whether the browser supports any other PDF Reader plugin |
| RealPlayer | Indicates whether the browser supports the Real Player plugin |
| Key | Description |
|---|---|
| Javascript | Indicates whether the browser supports JavaScript |
| Touch | Indicates whether the browser supports the HTML5 touch events API |
| GeoLocation | Indicates whether the browser supports the HTML5 Geo Location API |
| PostMessage | Indicates whether the browser supports the HTML5 Post Message API |
| HashChange | Indicates whether the browser supports the HTML5 HashChange event |
| History | Indicates whether the browser supports the HTML5 History API |
| DragAndDrop | Indicates whether the browser supports the HTML5 Drag And Drop API |
| FullScreen | Indicates whether the browser supports the FullScreen API |
| SpeechInput | Indicates whether the browser supports the Speech Input API |
| Cookies | Indicates whether browser supports the cookies |
| Unicode | Indicates whether the browser supports the unicode |
| StrictMode | Indicates whether the browser supports the EcmaScript5 strict mode |
| JSON | Indicates whether the browser supports the native JSON API |
| MathML | Indicates whether the browser supports MathML |
| DeviceMotion | Indicates whether the browser supports the devicemotion events |
| DeviceOrientation | Indicates whether the browser suppor the deviceorientation events |
| Battery | Indicates whether the browser supports the Battery Status API |
| FileReader | Indicates whether the browser supports the FileReader API |
| FileSystem | Indicates whether the browser supports the FileSystem API |
| IE8Compat | Indicates whether the IE8 compatibility mode is enabled in Microsoft Internet Explorer |
| Key | Description |
|---|---|
| IndexedDB | Indicates whether the browser supports the HTML5 Indexed Database API |
| LocalStorage | Indicates whether the browser supports the HTML5 Local Storage API |
| SessionStorage | Indicates whether the browser supports the HTML5 Session Storage API |
| ApplicationCache | Indicates whether the browser supports the HTML5 Offline Application Cache API |
| Key | Description |
|---|---|
| WebSockets | Indicates whether the browser supports the HTML5 WebSockets API |
| WebSocketsBinary | Indicates whether the HTML5 WebSockets API can accept binary data |
| WebWorkers | Indicates whether the browser supports the HTML5 WebWorkers API |
| Key | Description |
|---|---|
| Canvas | Indicates whether the browser supports the HTML5 Canvas API |
| CanvasText | Indicates whether the browser supports the HTML5 Canvas Text API |
| WebGL | Indicates whether the browser supports the HTML5 WebGL API |
| SVG | Indicates whether the browser supports the HTML5 SVG API |
| Key | Description |
|---|---|
| Video | Indicates whether the browser supports the HTML5 <video> tag |
| Ogg | Indicates whether the browser supports the Ogg codec |
| H264 | Indicates whether the browser supports the H264 codec |
| WebM | Indicates whether the browser supports the WebM codec |
| Key | Description |
|---|---|
| Audio | Indicates whether the browser supports the HTML5 <audio> tag |
| mp3 | Indicates whether the browser supports the mp3 codec |
| wav | Indicates whether the browser supports the wav codec |
| m4a | Indicates whether the browser supports the m4a codec |
| Key | Description |
|---|---|
| Tags | |
| OutputElem | Indicates whether the browser supports the HTML5 <output> tag |
| ProgressBar | Indicates whether the browser supports the HTML5 <progress> tag |
| Meter | Indicates whether the browser supports the HTML5 <meter> tag |
| Details | Indicates whether the browser supports the HTML5 <details> tag |
| Ruby | Indicates whether the browser supports the HTML5 <ruby> tag |
| Track | Indicates whether the browser supports the HTML5 <track> tag |
| Inputs | |
| Number | Indicates whether the browser supports the HTML 5 <input type=number> |
| Range | Indicates whether the browser supports the HTML 5 <input type=range> |
| Date | Indicates whether the browser supports the HTML 5 <input type=date> |
| DateTime | Indicates whether the browser supports the HTML 5 <input type=datetime> |
| DateTime-Local | Indicates whether the browser supports the HTML 5 <input type=datetime-local> |
| Month | Indicates whether the browser supports the HTML 5 <input type=month> |
| Week | Indicates whether the browser supports the HTML 5 <input type=week> |
| Time | Indicates whether the browser supports the HTML 5 <input type=time> |
| Tel | Indicates whether the browser supports the HTML 5 <input type=tel> |
| Indicates whether the browser supports the HTML 5 <input type=email> | |
| URL | Indicates whether the browser supports the HTML 5 <input type=url> |
| Color | Indicates whether the browser supports the HTML 5 <input type=color> |
| Search | Indicates whether the browser supports the HTML 5 <input type=search> |
| Attributes | |
| AutoComplete | Indicates whether the browser supports the HTML5 autocomplete attribute |
| AutoFocus | Indicates whether the browser supports the HTML5 autofocus attribute |
| List | Indicates whether the browser supports the HTML5 datalist element and list attribute |
| Placeholder | Indicates whether the browser supports the HTML5 placeholder attribute |
| Min | Indicates whether the browser supports the HTML5 min attribute |
| Max | Indicates whether the browser supports the HTML5 max attribute |
| Step | Indicates whether the browser supports the HTML5 step attribute |
| Multiple | Indicates whether the browser supports the HTML5 multiple attribute |
| Pattern | Indicates whether the browser supports the HTML5 pattern attribute |
| Required | Indicates whether the browser supports the HTML5 required attribute |
| FormValidation | Indicates whether the browser supports the Form Validation using required and pattern attributes |
| Key | Description |
|---|---|
| MediaQueries | Indicates whether the browser supports the CSS3 media queries |
| GeneratedContent | Indicates whether the browser supports the CSS2/CSS3 generated content :before / :after / content |
| FontFace | Indicates whether the browser supports the CSS3 web font |
| Flexbox | Indicates whether the browser supports the CSS3 flexbox |
| RGBa | Indicates whether the browser supports the CSS3 RGB with Alpha |
| HSLa | Indicates whether the browser supports the CSS3 HSLA |
| MultipleBgs | Indicates whether the browser supports the CSS3 multiple background |
| BackgroundSize | Indicates whether the browser supports the CSS3 background size property |
| BorderImage | Indicates whether the browser supports the CSS3 border image properties |
| BorderRadius | Indicates whether the browser supports the CSS3 border radius properties |
| BoxShadow | Indicates whether the browser supports the CSS3 box shadow property |
| TextShadow | Indicates whether the browser supports the CSS3 text shadow property |
| Opacity | Indicates whether the browser supports the CSS3 opacity property |
| CSSAnimations | Indicates whether the browser supports the CSS3 animations properties |
| CSSColumns | Indicates whether the browser supports the CSS3 multi-columns properties |
| CSSGradients | Indicates whether the browser supports the CSS3 linear-gradient, radial-gradients... properties |
| CSSReflections | Indicates whether the browser supports the CSS3 reflections properties |
| CSSTransforms | Indicates whether the browser supports the CSS3 transforms properties |
| CSSTransforms3D | Indicates whether the browser supports the CSS3 3D transforms properties |
| CSSTransitions | Indicates whether the browser supports the CSS3 transitions properties |