I have been asked many times on how to customize Receiver for Web to log off from the site after an application or desktop is launched. So, I think I should share the customization here.
Simply add the following code snippet to script.js in the custom folder for the Receiver for Web site (typically C:\inetpub\wwwroot\Citrix\StoreWeb\custom\) you would like to customize:
var delayLogoffInSeconds = 10; CTXS.Extensions.beforeWebLogoffIca = function(action) { return 'none'; }; CTXS.Extensions.postLaunch = function(app, status) { if (! CTXS.Device.isNativeClient()) { if (status == CTXS.LAUNCH_SUCCESS) { function logoff() { CTXS.Environment.logOff(); } window.setTimeout(logoff, delayLogoffInSeconds * 1000); } } };
This code snippet logs off from the Receiver for Web site 10 seconds after a successful launch. In the case of an HDX application/desktop, it is 10 seconds after the ICA file is successfully downloaded. You should ensure that the delay time for logoff is sufficient to establish an HDX connection in your environment. This timing can be adjusted by altering the value of delayLogoffInSeconds. This code snippet has been tested with StoreFront 3.0 and 3.8 but it should work with all of 3.x versions for the Unified Receiver UI (i.e. not green bubble).
This code snippet also works for NetScaler Unified Gateway for the Receiver for Web UI (RfWebUI) theme. For standard RfWebUI theme, the file to customize is /var/netscaler/logon/LogonPoint/custom/script.js. For custom theme based on RfWebUI, the file location is /var/netscaler/logon/themes/<themename>/script.js.