webext-messenger
Advanced tools
Comparing version 0.15.0 to 0.15.1-0
@@ -31,8 +31,11 @@ import browser from "webextension-polyfill"; | ||
action) { | ||
const { type, target, args, options: { trace } = {} } = message; | ||
debug(type, "↘️ received", { sender, args }); | ||
const { type, target, args, options = {} } = message; | ||
const { trace = [] } = options; | ||
trace.push(sender); | ||
const meta = { trace }; | ||
debug(type, "↘️ received", { sender, args, wasForwarded: trace.length > 1 }); | ||
let handleMessage; | ||
if (action === "forward") { | ||
debug(type, "🔀 forwarded", { sender, target }); | ||
handleMessage = async () => messenger(type, { trace }, target, ...args); | ||
handleMessage = async () => messenger(type, meta, target, ...args); | ||
} | ||
@@ -44,4 +47,3 @@ else { | ||
} | ||
debug(type, "➡️ will be handled here"); | ||
const meta = { trace: [sender] }; | ||
debug(type, "➡️ will be handled here,", getContextName()); | ||
handleMessage = async () => localHandler.apply(meta, args); | ||
@@ -48,0 +50,0 @@ } |
{ | ||
"name": "webext-messenger", | ||
"version": "0.15.0", | ||
"version": "0.15.1-0", | ||
"description": "Browser Extension component messaging framework", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
22294
391