Citrix Workspace For Html5

Posted on  by admin

Type Definitions¶

Citrix Receiver for HTML5 product software. Citrix Workspace App Workspace app for HTML5 Subscribe to RSS notifications of new downloads. Passing 'CDN' would consume the latest HTML5 Workspace app build from Citrix CDN. However, this can be overridden by setting path with the location of HTML5 Workspace app build hosted by customer. Defaults to CDN. FallbackPath: string If CDN is not reachable then the HTML5 Workspace app build is picked from the location set using. Other HTML5 Receiver configurations you can change by either editing C: Program Files Citrix Receiver StoreFront HTML5Client configuration.js, or use the Citrix Workspace app (earlier known as Citrix Receiver) for Chrome and HTML5 – Configuration Utility downloadable from CTX229141.

connectionParams¶

Configuration options to create the session.

Type¶

  • Object

Properties:¶

NameTypeDescription
connectionParamsObject
Properties
NameTypeAttributesDescription
launchTypeString <optional>
Takes 'newtab' or 'embed' as value. Defaults to 'newtab'.
'newtab' - launches the session in a new tab.
'embed' - Opens the session in an Iframe.
containerObjectSpecifies the ID and the type of container for the session when launchType is embed.
Properties
NameTypeDescription
idStringID of the iframe element to embed the session. Mandatory parameter when launchType is embed.
typeStringType of the element to embed the session. Should be set to 'iframe'.
boundsObject <optional>
Sets a fixed width and height to the session.
Properties
NameTypeDescription
autoresizebooleanShould be set to false to give fixed width and height to session. By default, this value is set to true in which case the session is resized to match the size of iframe element or the tab.
widthNumberWidth of the session specified in pixels. This value will be set only when autoresize is set to false.
heightNumberHeight of the session specified in pixels. This value will be set only when autoresize is set to false.
closeOptionsObject <optional>
Action on disconnecting the session. Defaults to type='close'.
Properties
NameTypeDescription
typeStringSpecifies the type of action.
type=”redirectUrl” would redirect the tab to the URL specified in value.
type=”close” would set the iframe src to 'about:blank' when launchType is 'embed' and closes the tab when launchType is 'newtab'.
valueStringSpecifies the URL to be redirected. When type is set to 'close',this value would be ignored.
showDisconnectAlertbooleanA prompt would be shown to the user to stay/leave the current page when the session is about to disconnect due to the actions like close/reload of the tab.
If the value is set to true then the prompt is displayed otherwise prompt won't be shown.
Default value is true.
preferredLangString <optional>
Specifies the preferred language code to be used inside the session. If the language code specified is either invalid or unsupported then it falls back to 'en'.
Supported language codes : en, de, es, fr, ja, ko, ru, zh, zh-cn, zh-tw
If the value is unspecified then the browser's language code is used.
preferencesObject <optional>
JSON to hide/show toolbar or individual toolbar items, suppressing the FTU, URLRedirection and error dialog.
Refer to the example below.

Example¶

Listener to handle the events.

Parameters¶

NameTypeDescription
eventObjectObject as appropriate to the eventType registered.

Properties¶

NameTypeDescription
event.idStringId of the session object.
event.typeStringEvent Type triggered.
event.dataObjectData as appropriate to the event triggered.
- onConnection
- onConnectionClosed
- onURLRedirection
- onError
- onResize

onSessionCreated(sessionObject)¶

Citrix

Callback having the session object created.

Parameters¶

NameTypeDescription
sessionObjectSessionSession object to interact with the session like register and handle events, start and disconnect.

Example¶

new Session()

Members¶

container¶

Contains the type and value of the container where the session is launched.

Properties¶

NameTypeDescription
containerObject
Properties
NameTypeDescription
typeStringType of the container. Will be set to 'iframe' or 'window' when launchType is set to 'embed' or 'newtab' respectively.
valueObjectContains the iframe DOM object or reference to the window where the session is launched based on the launchType.

(readonly) id¶

Properties¶

NameTypeDescription
idStringID of the object

Methods¶

(inner) addListener(eventType, eventListener)¶

Registers the eventListener on the eventType.

Parameters¶

NameTypeDescription
eventTypeStringType of the event for which the listener needs to be attached. Supported event types:
- onConnection
- onConnectionClosed
- onURLRedirection
- onError
- onResize
eventListenereventListenerListener to handle the event

Example¶

(inner) addToolbarBtns(customToolbarData)¶

Adds the custom buttons to the in-session toolbar.

Parameters¶

NameTypeDescription
customToolbarDataArray.<Object>Array of objects containing the custom toolbar buttons to be added where each object contains more details of the button to be added.
Note: Toolbar should be enabled to use this method.
Properties
NameTypeDescription
idStringid of the button
config.isPrimarybooleanValue set to true specifies that the button to be added to primary toolbar buttons.
Setting to false would add to secondary menu (present under more button).
Defaults to true.
config.imageUrlStringImage url of the button. Mandatory when the button is added to primary toolbar button.
Note:
Recommendation is to host the images where SDK files are hosted and give full path of the image.
Other option is to use the data URL of the image.
If the images are hosted in origin other than that of SDK then Content security policy in HDXEngine.html has to be edited to allow the images to be fetched.
config.positionStringSpecifies the position of the custom button when added as primary toolbar button.For secondary custom buttons it would be appended to the menu shown on clicking more button.
1) Setting to 'front' would add the button to the front of the toolbar (immediately after receiver button).
2) Setting to 'rear' would add the button before more button.
Note : For secondary custom buttons it would be appended to the menu shown on clicking more button.
Defaults to 'front' when unspecified.
config.toolTipStringValue is set as tooltip if the custom button is primary.
For secondary the value is shown as the menu item.
handlereventListenerEvent listener that listens for the click of the custom toolbar button.

Examples¶

Example 1: Adding help custom button to primary toolbar and position is set to rear(added before more button)

Example 2: Adding back and forward buttons that allows navigation of the webpage in browser and position is set to front (added after Workspace app button).

Example 3: Adding help custom button as primary toolbar with position set to rear and contact us button as secondary button.

(inner) changeResolution(bounds)¶

Changes the resolution of the session.

Parameters¶

NameTypeDescription
boundsObjectContains session resolution settings

Properties¶

NameTypeDescription
bounds.autoresizebooleanShould be set to false to give fixed width and height to session. If this value is set to true then the session is resized to match the size of iframe element or the tab.
bounds.widthNumberWidth of the session specified in pixels. This value will be set only when autoresize is set to false.
bounds.heightNumberHeight of the session specified in pixels. This value will be set only when autoresize is set to false.

Examples¶

Example 1: To change resolution to fixed width and height

Example 2: To change the session resolution to match the iframe element or tab size

(inner) disconnect()¶

Disconnects the session.

(inner) logoff()¶

Sends logoff to the session.

(inner) removeListener(eventType, eventListener)¶

Removes the eventListener on the eventType.

Parameters¶

NameTypeDescription
eventTypeStringType of the event for which the listener needs to be removed. Supported event types:
- onConnection
- onConnectionClosed
- onURLRedirection
- onError
- onResize
eventListenereventListenerListener to handle the event

Example¶

(inner) removeToolbarBtns(toolbarButtonIds)¶

Removes the custom toolbar buttons added to in-session toolbar.

Parameters¶

NameTypeDescription
toolbarButtonIdsArray <String>Array of custom toolbar button ids to be removed.

Example¶

Example 1: Removing the help button added using addToolbarBtns example.

Example 2: Removing multiple buttons say back and forward buttons added using addToolbarBtns example.

(inner) sendSpecialKeys(keys)¶

Sends a key combination to the session.

Parameters¶

NameTypeDescription
keysArrayArray of strings with each one representing a key. Supported keys Alt, Control, Shift, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Home, End, PageUp, PageDown, Backspace, Delete, F5, PrintScreen,Insert, Escape, Tab. Till 1.1 version only 'ctrl+alt+del' was supported. From 1.2 version, more key combinations can be sent to session.

Example¶

Example 1: Sends Ctrl+alt+delete to the session.

Example 2: To preview different apps running inside session, Ctrl+alt+tab can be sent.

Citrix Workspace For Windows 8

(inner) start(launchData)¶

Starts the session.

Parameters¶

NameTypeDescription
launchDataObjectContains the type and value of ICA.

Properties:¶

Citrix Workspace App For Html5 Copy Paste

NameTypeDescription
launchData.typeStringSpecifies the data type of ICA data. Allowed values are 'json' or 'ini'.
launchData.valueStringICA data to start the session. It should be a JSON object when type is 'json' or a string read from a .ini file when type is 'ini'.

Citrix Workspace App For Html5 Microphone

Examples¶

Citrix Workspace Download

Example 1: When ICA data is in JSON format

Citrix Workspace App For Html5

Example 2: When ICA data is in INI format