New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 765691 link

Starred by 12 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Chrome should look for NativeMessagingHosts in the default location when using user-data-dir argument

Reported by ja...@agilebits.com, Sep 15 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8

Steps to reproduce the problem:
1. Install 1Password for Mac
2. Launch Chrome using the user-data-dir argument to point to a non-standard location.
3. Install the 1Password Chrome extension: https://chrome.google.com/webstore/detail/1password-password-manage/aomjjhallfgjeglblehebfpbcfeobpgk
3. Inspect the background page Console tab

What is the expected behavior?
1Password is able to connect from Chrome and provide its normal functionality.

What went wrong?
1Password is unable to connect because Chrome only looks for the NativeMessagingHosts folder as a subdirectory of the user-data-dir folder. Providing a symlink from the user-data-dir location to ~/Library/Application Support/Google/Chrome/NativeMessagingHosts allows 1Password to connect.

WebStore page: 

Did this work before? N/A 

Chrome version: Version 61.0.3163.91 (Official Build) (64-bit)  Channel: stable
OS Version: OS X 10.12.6
Flash Version: 

Extensions that rely on a native messaging connection are non-functional out of the box when the user launches Chrome with the user-data-dir argument. Since the runtime.lastError populated when the disconnect event handler fires is informational only and its strings not guaranteed to be stable, it is risky for the extension to attempt to recover the situation, and a generic help page is not feasible because of the number of ways that the native messaging host might not be available. See e.g.  Bug 725513  The developers of native apps can reasonably be expected to locate the default location for the NativeMessagingHosts folder, but supporting arbitrary file locations is out of scope, especially for Mac App Store deployments.

If the user has installed an extension in the custom user-data-dir, then they obviously want the extension to be able to use the native messaging host. They should not need to know about the implementation details of how Chrome looks for this.

For special situations such as a developer doing special testing of a native messaging host or other unusual cases, _allow_ for the user-data-dir to contain a manifest that overrides the default one, but this should be a capability for these use cases rather than the basic requirement for regular users to have their extensions work. A non-technical user using user-data-dir is not as uncommon as it might seem since there are articles[1][2] that discuss creating scripts to handle launching Chrome with custom user data directory.

[1] https://www.lessannoyingcrm.com/blog/2010/08/149/Create+application+shortcuts+in+Google+Chrome+on+a+Mac
[2] https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#Writing-an-AppleScript-wrapper-Mac-OS-X
 
Cc: sc00335...@techmahindra.com
Labels: Needs-Triage-M61 Triaged-ET M-63 OS-Linux OS-Windows
Status: Untriaged (was: Unconfirmed)
Tested the issue on reported version 61.0.3163.91 and on latest canary 63.0.3221.0 using Mac 10.12.6,Ubuntu 14.04 and Windows 10 and is reproducible with below steps. 

1.Launched Chrome using the user-data-dir argument  pointed to a non-standard location. [Followed steps from https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md#Writing-an-AppleScript-wrapper-Mac-OS-X]
2.Added 1Password Chrome extension and opened background page.
3.Observed 1Password is unable to connect to chrome. Attaching screenshot for reference.

This issue is seen from M50.[50.0.2661.0]. So considering this as Non-Regression issue and marking it as Untriaged.

Thanks!
Issue 765691.png
50.6 KB View Download
Owner: rdevlin....@chromium.org
Status: Assigned (was: Untriaged)
Q for Devlin, is there something special about the NativeMessagingHosts directory? If not, this sounds like a bug.
Any update on this bug? The behavior is confusing even for the advanced users that use user-data-dir and moreso for users that follow guides like I linked to in the initial report who are not guaranteed to be as technical.

Sign in to add a comment