Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Extension: 1Password 4.6.7.90 #9946

Closed
2 of 5 tasks
jonathansampson opened this issue Jul 11, 2017 · 10 comments
Closed
2 of 5 tasks

Extension: 1Password 4.6.7.90 #9946

jonathansampson opened this issue Jul 11, 2017 · 10 comments

Comments

@jonathansampson
Copy link
Collaborator

jonathansampson commented Jul 11, 2017

A Note on Development Testing

1Password expects Brave to be signed. This is the case with general releases, but is not presently the case with electron-prebuilt releases of Muon. For this reason, 1Password may refuse to communicate when the user is testing from a local clone of the browser-laptop project.

Testing 4.6.7.90 on a General Release

In order to test a newer version of 1Password, the user can enable 4.6.3 (current offered version in Brave), which results in the creation of %appdata%/brave/Extensions/aomjjhallfgjeglblehebfpbcfeobpgk/4.6.3.90/. The contents of this directory can be replaced with an unpacked 4.6.7.90, downloaded from the Chrome webstore.

On macOS, the user may need to copy the Chrome/NativeMessagingHosts directory over to Brave/NativeMessagingHosts to give Brave access to the 1Password manifest. Ideally, Brave would read from any pre-existing Chrome/NativeMessagingHosts directory.

General Issues

  • Context menu lacks interactive icons

Explanation: This is due to the background script not reaching the contextMenu logic. The lack of support for chrome.browserAction.enable causes a throw to occur.

  • chrome.browserAction.enable is not a function from setToolbarEnabled

Explanation: This issue has been addressed in part. It is important to achieve a full implementation (which allows for disabling and enabling the browserAction button. This button prevents the user from spinning up a new 1Password process during updates, etc.

  • Clicking the browser-action icon raises the following:
Uncaught (in promise) Error: Attempting to use a disconnected port object
    at PortImpl.postMessage (extensions::messaging:79:13)
    at Port.publicClassPrototype.(anonymous function) [as postMessage] (extensions::utils:149:26)
    at C.send.send (chrome-extension://bbfiipknkgjieboiachfddfkeagnkllg/global.min.js:166:24)
    at E.<anonymous> (chrome-extension://bbfiipknkgjieboiachfddfkeagnkllg/global.min.js:216:322)
    at E.connectionWillEstablishConnection.vb (chrome-extension://bbfiipknkgjieboiachfddfkeagnkllg/global.min.js:228:382)
    at C.<anonymous> (chrome-extension://bbfiipknkgjieboiachfddfkeagnkllg/global.min.js:192:323)
    at <anonymous>

Explanation: When testing locally, 1Password doesn't permit Brave to communicate with the Native application. This can be avoided by following the General Release testing steps at the top of this issue.

  • Upon launch, 1Password attempts to connect to the Native Message Host 2bua8c4s2c.com.agilebits.1password, but fails (after adding the local extension ID to the receiving native-messaging manifest on Windows):

image

  • Brave on macOS does not check Chrome/NativeMessagingHosts for manifests.

Related Issues

@rudyrichter
Copy link

let me know if you need any assistance with the Native Host has exited, are you testing with 6.8.BETA-8?

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jul 12, 2017

@rudyrichter Thank you for the generous offer. We're testing 4.6.7.90 (current latest in Chrome webstore). We are running into an issue with native messaging though (Native host has exited.), and the minified source is making things tougher to troubleshoot. Would it be possible to get a build of the extension that isn't minified?

Platform: Windows 10 (15036.483)
1Password: 6.6.439
Enable Native Messaging for Chrome is checked

Native Messaging issues may be related to those noted here.

@rudyrichter
Copy link

"after adding the local extension ID to the receiving native-messaging manifest"

what exactly does this mean? I suspect that's the problem, we only allow a fixed set of origins in both the Mac and Windows versions.

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jul 13, 2017

@rudyrichter When we load an unpacked extension (which we need to do for testing), the extension ID is generated from the filesystem path. As a result, it won't be the expected ID. I took the generated ID and added it as an allowed_origin in the ChromeManifest.json file (located via the Registry). This resolved Host not allowed messages.

@rudyrichter
Copy link

@jonathansampson I'm pretty sure that's not going to work, 1Password for Mac and Windows have a baked in set of origins they accept NM connections from. Anything other than that is rejected outright.

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jul 13, 2017

@rudyrichter Understood. This is the manifest that comes with 1Password:

{
	"name": "2bua8c4s2c.com.agilebits.1password",
	"description": "1Password",
	"path": "\\1Password.NativeMessagingHost.exe",
	"type": "stdio",
	"allowed_origins": [
		"chrome-extension://jcjaoeifeheahnjbolddgagkiahngegm/",
		"chrome-extension://aomjjhallfgjeglblehebfpbcfeobpgk/",
		"chrome-extension://phicbbndgmmpogmijjkbmdhpioaieaha/",
		"chrome-extension://fpnbobholfpcolmkinlokiaaanjilcop/",
		"chrome-extension://ffgeebhnlfcekjbfekfppddlklaopmok/"
	]
}

For testing purposes, I added another origin to reflect the extension's ID in Brave.

Is there something additional that needs to be done?

@rudyrichter
Copy link

that manifest file is only used by the browser to decide if the extension itself should use this particular manifest in figuring out if there is a NM manifest.

you're probably seeing the 1Password NM process launch and do nothing, this is how it reacts when a origin other than the ones it has baked into it tries to connect.

@jonathansampson
Copy link
Collaborator Author

@rudyrichter I appreciate the prompt response. I was able to load the same source files as an unpacked extension in Chrome, and run without any issue. Chrome had the same ID as Brave, since both were loading the unpacked extension from the same directory. This suggested there may be something within Brave that needs to be adjusted.

I tested Chrome a couple of days ago in this manner, and will do it again here momentarily to be certain of these results. I'll update this issue shortly with my findings.

@jonathansampson
Copy link
Collaborator Author

jonathansampson commented Jul 13, 2017

Just ran through the following scenario and found success in Chrome, failure in Brave:

  1. ced aomjjhallfgjeglblehebfpbcfeobpgk
  2. configure in app\extensions.js (see https://blog.brave.com/loading-chrome-extensions-in-brave/)
  3. npm run watch, and npm run start
  4. Navigate to chrome-extension://<extension-id>/_generated_background_page.html (extension-id found in about:extensions)
  5. Rename _metadata to x_metadata in order to load as "unpacked extension" in Chrome
  6. Both Brave and Chrome show "Access to the specified native messaging host is forbidden". Both also have identical <extension-id> values.
  7. Modified ChromeManifest.json to add chrome-extension://bbfiipknkgjieboiachfddfkeagnkllg/ as an allowed origin.
  8. On next attempt to connect, Chrome is "Showing AS" while Brave is "Native Host has Exited" (see http://imgur.com/c9br3BF)

@jonathansampson
Copy link
Collaborator Author

Closed in part by brave/muon#259

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.