Gracefully handle legacy message recipients.

This commit is contained in:
hackademix 2018-09-14 07:18:10 +02:00
parent 8c739b064c
commit 71c82b5084
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@
},
async send(name, args = {}, recipientInfo = null) {
args.__meta = {name, recipientInfo};
args._messageName = name; // legacy protocol, for embedders
if (recipientInfo && "tabId" in recipientInfo) {
let opts;
if ("frameId" in recipientInfo) opts = {frameId: recipientInfo.frameId};