Receiver for Web Workaround with NPAPI Support Removal in Google Chrome

Receiver for Web Workaround with NPAPI Support Removal in Google Chrome

book

Article ID: CTX200889

calendar_today

Updated On:

Description

This article is intended for Citrix administrators and technical teams only.
 
Non-admin users must contact their company's Help Desk/IT support team and can refer to CTX297149 for more information.

 

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.

  • Users will be prompted to install Citrix Receiver every time they access the Receiver for web site.

  • An ICA file will be saved when users try to launch an application or desktop. They will have to click the ICA file at the bottom of the browser to activate the launch.

  • Workspace control will be disabled on Windows.

User-added image

Background

​To improve Chrome’s security and stability, Google announced late 2014 that NPAPI plugin support, a capability we have depended on for years, will be disabled by default in Chrome by April 2015. NPAPI is a plugin that Receiver for Windows and Mac that enables Receiver for Web to detect if Receiver is installed. It also enables users to launch applications by simply clicking them.

Environment

Citrix is not responsible for and does not endorse or accept any responsibility for the contents or your use of these third party Web sites. Citrix is providing these links to you only as a convenience, and the inclusion of any link does not imply endorsement by Citrix of the linked Web site. It is your responsibility to take precautions to ensure that whatever Web site you use is free of viruses or other harmful items.

Resolution

While Citrix is actively working on new technology that will replace our dependency on NPAPI plugins, there are some workarounds that can be taken in the short term.

Use one of the following workarounds to fix the issue:

Workaround 1

Use a different Citrix Receiver supported web browser such as Internet Explorer, Mozilla Firefox, or Apple Safari to connect.

Workaround 2

Re-Enable NPAPI within the Chrome address bar

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.

Important Note - Consult the security specialist of your organization before  change:

To re-enable the NPAPI plugin in Chrome:

  1. Type chrome://flags/#enable-npapi in your browser’s address bar.
  2. Click Enable.
  3. Quit Chrome (close all open windows) and restart the browser.
  4. Use Task Manager to verify there are no running Chrome.exe processes listed. If there are any still running end those tasks before logging on.
  5. Go back to your website and logon. The applications should now launch normally.

Customize Receiver for Web

If you do not want to or cannot disable Chrome auto update or re-enable NPAPI Plugin, you can do a number of customization to Receiver for Web to reduce the disruption.
Note: All the customization code in this article is applicable to StoreFront 2.6.

Disable client download prompt for Chrome

If you insert the following code into custom.script.js in the contrib folder under the Receiver for Web site, Chrome users 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 preceding code snippet helps you disable the Receiver install prompt for Chrome. However, you might 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 similar to the following:

User-added image

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 ensure that this never happens, that is, 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 && ! CTXS.resources.isUnauthenticatedStore);
        } else {
            return origIsAllowed();
        }
    };
    CTXS.WorkspaceControl.isSessionReconnectAllowed = function() {
        var userHasAppsInStore = (CTXS.resources.numStoreResources > 0);
        var appsAreShownToUser = (CTXS.Config.userInterface.uiViews.showAppsView == 'true');
        var workspaceControlEnabled = CTXS.WorkspaceControl.isAllowed();
        return workspaceControlEnabled && userHasAppsInStore && 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 && generalSessionReconnectAllowed &&
                allowedByAppShortcuts && !desktopAutoLaunch;
        } else {
            return origIsAutoSessionReconnectAllowed();
        }
    };
});

Enable Chrome To Open ICA file Automatically

After 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 an application/desktop icon to launch.

User-added image

Issue/Introduction

This article provides workaround for issues arising due to NPAPI Being Disabled by Google Chrome.