webext-messenger
Advanced tools
Comparing version 0.25.1 to 0.25.2
@@ -1,2 +0,2 @@ | ||
import { isBackground, isContentScript, isExtensionContext, } from "webext-detect-page"; | ||
import { getContextName, isBackground, isContentScript, isExtensionContext, } from "webext-detect-page"; | ||
import { messenger } from "./sender.js"; | ||
@@ -115,2 +115,3 @@ import { registerMethods } from "./receiver.js"; | ||
} | ||
// TODO: Add tests | ||
export async function getThisFrame() { | ||
@@ -120,3 +121,8 @@ await storeTabData(); // It should already have been called but we still need to await it | ||
if (typeof tabId !== "number" || typeof frameId !== "number") { | ||
throw new TypeError("This target is not in a frame"); | ||
let moreInfo = "(error retrieving context information)"; | ||
try { | ||
moreInfo = `(context: ${getContextName()}, url: ${globalThis.location?.href})`; | ||
} | ||
catch { } | ||
throw new TypeError(`This target is not in a frame ${moreInfo}`); | ||
} | ||
@@ -123,0 +129,0 @@ // Rebuild object to return exactly these two properties and nothing more |
{ | ||
"name": "webext-messenger", | ||
"version": "0.25.1", | ||
"version": "0.25.2", | ||
"description": "Browser Extension component messaging framework", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
31917
631
0