To improve Chrome’s security and stability, Google announced late last year that NPAPI plugin support, a capability we’ve depended on for years, will be disabled by default in Chrome in April 2015. The NPAPI plugin that Receiver for Windows and Mac install enables Receiver for Web to detect that Receiver is installed and enables users to launch applications simply by clicking on them. The removal of NPAPI support will affect user experience for users who access Citrix Receiver for Web using the Chrome browser on Windows and Mac.

  1. Users will be prompted to install Citrix Receiver every time they access the Receiver for Web site.
  2. An ICA file will be saved when users try to launch an application or desktop. They have to click the ICA file at the bottom of the browser to activate the launch.
  3. Workspace control will be disabled on Windows.

While we are actively working on new technology that will replace our dependency on NPAPI plugins, there are some workarounds you can take in the short term. Here are what you can do.

Re-Enable NPAPI

As stated here, NPAPI can still be enabled in Chrome by advanced users and enterprises after April 2015 when it is disabled by default. However, this will only work until September 2015 when Google Chrome will completely disable NPAPI.

Customize Receiver for Web

If you don’t want to or cannot re-enable NPAPI Plugin, there are a number of customization that can be done to Receiver for Web to reduce the disruption. All the customization code in this article is applicable to StoreFront 2.6.

Disable client download prompt for Chrome

If you insert the code below into custom.script.js in the contrib folder under the Receiver for Web site, users of Chrome browser will never be prompted to install Citrix Receiver.

$(document).ready(function () {
    function endPluginAssistant() {
        CTXS.setCookie(CTXS.COOKIE_PLUGIN_ASSISTANT_STATE, CTXS.PLUGIN_ASSISTANT_DONE);
        if (CTXS.getCookie(CTXS.COOKIE_PLUGIN_ASSISTANT_STATE) === null) {
            CTXS.displayTemplate("CookiesAreDisabled");
        } else {
            CTXS.Application.displaySpinner();
            CTXS.Events.publish(CTXS.Events.pluginAssistant.done);
        }
    };
    var origInit = CTXS.PluginDetection.init;
    CTXS.PluginDetection.init = function() {
        if (CTXS.ClientInfo.isChrome()) {
            endPluginAssistant();
            return;
        }

        origInit();
    }
});

Provide a permanent link for downloading Receiver in Chrome

The above code snippet helps you disable the Receiver install prompt for Chrome. However, you may still want your users to be able to download and install Receiver if needed. Apply the following code snippet in custom.script.js will add a link to the user menu to download Receiver for Chrome browser.

$(document).ready(function () {
    $.ctxs.ctxsUserMenu.prototype._origGenerateDropDownMenu = $.ctxs.ctxsUserMenu.prototype._generateDropDownMenu;
    $.ctxs.ctxsUserMenu.prototype._generateDropDownMenu = function(ddMenu) {
        var self = this;
        var $mBody = ddMenu.children(".usermenu-body");
        if (CTXS.ClientInfo.isChrome() && (CTXS.ClientInfo.isWindows() || CTXS.ClientInfo.isMacOSX())) {
            var clientUrl = CTXS.ClientInfo.isWindows() ? CTXS.Config.pluginAssistant.win32.path : CTXS.Config.pluginAssistant.macOS.path;
            $mBody.append('<a id="userdetails-downloadreceiver" class="_ctxstxt_DownloadReceiver _ctxstip_DownloadReceiverToolTip" href="{0}" role="menuitem"></a>'.format(clientUrl));
        }
        self._origGenerateDropDownMenu(ddMenu);
    };
});

You have to also add the following strings to custom.wrstrings.en.js and a localized version for every language you need to support to custom.wrstrings.<language>.js.

    DownloadReceiver: 'Install Receiver',
    DownloadReceiverToolTip: 'Install Receiver on your desktop',

The resultant UI looks like:

Provide users with choice of client

If you have taken the advantage of auto fall back to Receiver for HTML5 feature in your deployment, unfortunately, it will not work as Receiver for Web is no longer able to detect whether the native Receiver is installed. As a mitigation, the above customization can be extended to provide users with a choice of Receivers to use. Here is the code snippet to provide both a download link and a receiver choice menu item.

$(document).ready(function () {
    $.ctxs.ctxsUserMenu.prototype._origGenerateDropDownMenu = $.ctxs.ctxsUserMenu.prototype._generateDropDownMenu;
    $.ctxs.ctxsUserMenu.prototype._generateDropDownMenu = function(ddMenu) {
        var self = this;
        var $mBody = ddMenu.children(".usermenu-body");
        if (CTXS.ClientInfo.isChrome() &amp;&amp; (CTXS.ClientInfo.isWindows() || CTXS.ClientInfo.isMacOSX())) {
            var clientUrl = CTXS.ClientInfo.isWindows() ? CTXS.Config.pluginAssistant.win32.path : CTXS.Config.pluginAssistant.macOS.path;
            $mBody.append('&lt;a id="userdetails-downloadreceiver" class="_ctxstxt_DownloadReceiver _ctxstip_DownloadReceiverToolTip" href="{0}" role="menuitem"&gt;&lt;/a&gt;'.format(clientUrl));
        }

        if (CTXS.ClientInfo.isChrome() &amp;&amp; (CTXS.Config.pluginAssistant.html5.enabled == CTXS.Html5Client.ENABLED_FALLBACK) &amp;&amp; (! CTXS.Html5Client.mustUseHtml5Client())) {
      CTXS.Html5Client.usingHtml5Client = function (flag) {
                return (CTXS.getCookie("CtxsUseHtml5Client") == "true");
            };
            var label = (CTXS.getCookie("CtxsUseHtml5Client") == "true") ? $.localization.string('ChangeToFullClient') : $.localization.string('ChangeToLiteClient');
            var title = (CTXS.getCookie("CtxsUseHtml5Client") == "true") ? $.localization.string('ChangeToFullClientToolTip') : $.localization.string('ChangeToLiteClientToolTip');
            $mBody.append('&lt;a href="#" id="userdetails-changeclient" title="' + title + '" role="menuitem"&gt;' + label  + '&lt;/a&gt;')
                .find('#userdetails-changeclient')
                .click(function(event) {
                    if (CTXS.getCookie("CtxsUseHtml5Client") == "true") {
                        CTXS.setCookie("CtxsUseHtml5Client", "false", true);
                        $('#userdetails-changeclient').text($.localization.string('ChangeToLiteClient'));
                        $('#userdetails-changeclient').attr('title', $.localization.string('ChangeToLiteClientToolTip'));
                    } else {
                        CTXS.setCookie("CtxsUseHtml5Client", "true", true);
                        $('#userdetails-changeclient').text($.localization.string('ChangeToFullClient'));
                        $('#userdetails-changeclient').attr('title', $.localization.string('ChangeToFullClientToolTip'));
                    }
                    event.preventDefault();
                });
        }
        self._origGenerateDropDownMenu(ddMenu);
    };
});

You have to also add the following strings to custom.wrstrings.en.js and a localized version for every language you need to support to custom.wrstrings.<language>.js.

    DownloadReceiver: 'Install Receiver',
    DownloadReceiverToolTip: 'Install Receiver on your desktop',
    ChangeToLiteClient: "Change to HTML5 Receiver",
    ChangeToLiteClientToolTip: "You are currently using the full version of Receiver to launch applications. Click here to change to use the HTML5 version.",
    ChangeToFullClient: "Change to full Receiver",
    ChangeToFullClientToolTip: "You are currently using the HTML5 version of Receiver to launch applications. Click here to change to use the full version.",

The resultant UI looks like:

Enable Workspace Control For Chrome On Windows

Workspace control is disabled on Windows if Receiver for Web cannot detect whether the browser is running in an ICA session (pass-through mode). This is to avoid disconnecting the session running the browser itself. If you can make sure that this never happens, i.e. Chrome is never used in the double-hop deployment to access applications/desktops in the second-hop sharing the same XenApp/XenDesktop farms/sites, you can apply the following code snippet to custom.script.js in the contrib folder under the Receiver for Web site to enable workspace control for Chrome.

$(document).ready(function () {
    var origIsAllowed = CTXS.WorkspaceControl.isAllowed;
    CTXS.WorkspaceControl.isAllowed = function() {
        if (CTXS.ClientInfo.isChrome()) {
            return (CTXS.Config.userInterface.workspaceControl.enabled &amp;&amp; ! CTXS.resources.isUnauthenticatedStore);
        } else {
            return origIsAllowed();
        }
    };

    CTXS.WorkspaceControl.isSessionReconnectAllowed = function() {
        var userHasAppsInStore = (CTXS.resources.numStoreResources &gt; 0);
        var appsAreShownToUser = (CTXS.Config.userInterface.uiViews.showAppsView == 'true');
        var workspaceControlEnabled = CTXS.WorkspaceControl.isAllowed();

        return workspaceControlEnabled &amp;&amp; userHasAppsInStore &amp;&amp; appsAreShownToUser;
    };

    var origIsAutoSessionReconnectAllowed = CTXS.WorkspaceControl.isAutoSessionReconnectAllowed;
    CTXS.WorkspaceControl.isAutoSessionReconnectAllowed = function() {
        if (CTXS.ClientInfo.isChrome()) {
            var autoReconnectConfigured = CTXS.Config.userInterface.workspaceControl.autoReconnectAtLogon === 'true',
                generalSessionReconnectAllowed = CTXS.WorkspaceControl.isSessionReconnectAllowed(),
                allowedByAppShortcuts = !CTXS.AppShortcuts.isAppShortcutLaunch() ||
                    CTXS.Config.userInterface.appShortcuts.allowSessionReconnect === 'true',
                desktopAutoLaunch = CTXS.Resources.autoLaunchSingleDesktop();

            return autoReconnectConfigured &amp;&amp; generalSessionReconnectAllowed &amp;&amp;
                allowedByAppShortcuts &amp;&amp; !desktopAutoLaunch;
        } else {
            return origIsAutoSessionReconnectAllowed();
        }
    };
});

Enable Chrome To Open ICA file Automatically

Once the ICA file is saved, users can open the action menu for the ICA file at the bottom of the browser and select “Always open files of this type”. After that, launch will be automatically activated when the user clicks on an application/desktop icon to launch.