fix: honor extensionId arg in chrome.runtime.connect (#16998)

The first argument to chrome.runtime.connect is extensionId, not connectInfo.
This commit is contained in:
Stewart Lord 2019-05-01 19:42:04 -07:00 committed by Cheng Zhao
parent d4f5ebefe6
commit d507ba68a7

View file

@ -117,7 +117,7 @@ export function injectTo (extensionId: string, context: any) {
let targetExtensionId = extensionId
let connectInfo = { name: '' }
if (args.length === 1) {
connectInfo = args[0]
targetExtensionId = args[0]
} else if (args.length === 2) {
[targetExtensionId, connectInfo] = args
}