mirror of
https://github.com/electron/electron.git
synced 2026-01-25 23:38:18 -05:00
Merge pull request #6180 from jhen0409/patch-4
Fix chrome.runtime.sendMessage
This commit is contained in:
@@ -119,7 +119,13 @@ exports.injectTo = function (extensionId, isBackgroundPage, context) {
|
||||
if (args.length === 1) {
|
||||
message = args[0]
|
||||
} else if (args.length === 2) {
|
||||
[targetExtensionId, message] = args
|
||||
// A case of not provide extension-id: (message, responseCallback)
|
||||
if (typeof args[1] === 'function') {
|
||||
console.error('responseCallback is not supported')
|
||||
message = args[0]
|
||||
} else {
|
||||
[targetExtensionId, message] = args
|
||||
}
|
||||
} else {
|
||||
console.error('options and responseCallback are not supported')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user