From 4311cf168a6122ba5f14861d3133caa4e117ad67 Mon Sep 17 00:00:00 2001 From: FME849 <1414439@gmail.com> Date: Thu, 13 Jun 2024 12:46:38 +0700 Subject: [PATCH] update: include origin sender to payload --- src/chrome/kernel.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/chrome/kernel.ts b/src/chrome/kernel.ts index ddb661a..3d3d00a 100644 --- a/src/chrome/kernel.ts +++ b/src/chrome/kernel.ts @@ -19,6 +19,9 @@ export class ChromeKernel< chrome.runtime.onConnect.addListener((port) => { const channelId = port.name as ChannelId; port.onMessage.addListener((message, port) => { + if (!message.sender) { + message['sender'] = port.sender; + } this.execute(channelId, message, (payload) => { port.postMessage(payload); });