New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webext-messenger

Package Overview
Dependencies
Maintainers
0
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webext-messenger - npm Package Compare versions

Comparing version 0.29.0-0 to 0.29.0

37

distribution/thisTarget.js

@@ -29,18 +29,20 @@ import { getContextName, isBackground, isExtensionContext, isOffscreenDocument, } from "webext-detect";

// If a message is received before this is ready, it will just have to be ignored.
export const thisTarget = isBackground()
? { page: "background" }
: (isOffscreenDocument()
? { page: "offscreen" }
: {
get page() {
// Extension pages have relative URLs to simplify comparison
const origin = location.protocol.startsWith("http")
? location.origin
: "";
// Don't use the hash
return origin + location.pathname + location.search;
},
});
export const thisTarget = (() => {
if (isBackground())
return { page: "background" };
if (isOffscreenDocument())
return { page: "offscreen" };
return {
get page() {
// Extension pages have relative URLs to simplify comparison
const origin = location.protocol.startsWith("http")
? location.origin
: "";
// Don't use the hash
return origin + location.pathname + location.search;
},
};
})();
let tabDataStatus =
// The background page doesn't have a tab
// Exclude contexts that don't have a tab associated to them
isBackground() || isOffscreenDocument() ? "not-needed" : "needed";

@@ -57,3 +59,3 @@ export function getTabDataStatus() {

if ("prerendering" in document && Boolean(document.prerendering)) {
await pEvent(document, 'prerenderingchange');
await pEvent(document, "prerenderingchange");
}

@@ -80,4 +82,3 @@ try {

try {
moreInfo = `(context: ${getContextName()}, url: ${globalThis.location
?.href})`;
moreInfo = `(context: ${getContextName()}, url: ${globalThis.location?.href})`;
}

@@ -84,0 +85,0 @@ catch { }

{
"name": "webext-messenger",
"version": "0.29.0-0",
"version": "0.29.0",
"description": "Browser Extension component messaging framework",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -22,5 +22,4 @@ # webext-messenger [![][badge-gzip]][link-bundlephobia]

## npm publishing
Collaborators can publish a new version of what's on main [via "workflow_dispatch"](https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/) under [Actions » Publish](https://github.com/pixiebrix/webext-messenger/actions/workflows/npm-publish.yml)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc