🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@posthog/browser-common

Package Overview
Dependencies
Maintainers
22
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@posthog/browser-common - npm Package Compare versions

Comparing version
0.2.4
to
0.2.5
+1
-1
dist/config.js

@@ -29,3 +29,3 @@ "use strict";

});
const packageVersion = "0.2.4";
const packageVersion = "0.2.5";
const Config = {

@@ -32,0 +32,0 @@ DEBUG: false,

@@ -1,2 +0,2 @@

const packageVersion = "0.2.4";
const packageVersion = "0.2.5";
const Config = {

@@ -3,0 +3,0 @@ DEBUG: false,

@@ -40,11 +40,22 @@ "use strict";

const document = assignableWindow.document;
if (document && (0, core_namespaceObject.isFunction)(document.createElement)) try {
const sandbox = document.createElement('iframe');
sandbox.hidden = true;
document.head.appendChild(sandbox);
const contentWindow = sandbox.contentWindow;
if (contentWindow && contentWindow[name]) impl = contentWindow[name];
document.head.removeChild(sandbox);
} catch (e) {
external_logger_js_namespaceObject.logger.warn(`Could not create sandbox iframe for ${name} check, bailing to assignableWindow.${name}: `, e);
if (document && (0, core_namespaceObject.isFunction)(document.createElement)) {
let sandbox;
let keepSandboxAttached = false;
try {
sandbox = document.createElement('iframe');
sandbox.hidden = true;
document.head.appendChild(sandbox);
const contentWindow = sandbox.contentWindow;
if (contentWindow && contentWindow[name]) {
impl = contentWindow[name];
if ('MutationObserver' === name && (0, core_namespaceObject.isWebKit)(assignableWindow.navigator?.userAgent ?? '')) {
sandbox.classList.add('rr-block', 'ph-no-capture');
keepSandboxAttached = true;
}
}
} catch (e) {
external_logger_js_namespaceObject.logger.warn(`Could not create sandbox iframe for ${name} check, bailing to assignableWindow.${name}: `, e);
} finally{
if (!keepSandboxAttached && sandbox?.parentNode) sandbox.parentNode.removeChild(sandbox);
}
}

@@ -51,0 +62,0 @@ if (!impl || !(0, core_namespaceObject.isFunction)(impl)) return impl;

@@ -1,2 +0,2 @@

import { isFunction, isNativeFunction } from "@posthog/core";
import { isFunction, isNativeFunction, isWebKit } from "@posthog/core";
import { logger } from "./logger.mjs";

@@ -11,11 +11,22 @@ import { isAngularZonePresent } from "./type-utils.mjs";

const document = assignableWindow.document;
if (document && isFunction(document.createElement)) try {
const sandbox = document.createElement('iframe');
sandbox.hidden = true;
document.head.appendChild(sandbox);
const contentWindow = sandbox.contentWindow;
if (contentWindow && contentWindow[name]) impl = contentWindow[name];
document.head.removeChild(sandbox);
} catch (e) {
logger.warn(`Could not create sandbox iframe for ${name} check, bailing to assignableWindow.${name}: `, e);
if (document && isFunction(document.createElement)) {
let sandbox;
let keepSandboxAttached = false;
try {
sandbox = document.createElement('iframe');
sandbox.hidden = true;
document.head.appendChild(sandbox);
const contentWindow = sandbox.contentWindow;
if (contentWindow && contentWindow[name]) {
impl = contentWindow[name];
if ('MutationObserver' === name && isWebKit(assignableWindow.navigator?.userAgent ?? '')) {
sandbox.classList.add('rr-block', 'ph-no-capture');
keepSandboxAttached = true;
}
}
} catch (e) {
logger.warn(`Could not create sandbox iframe for ${name} check, bailing to assignableWindow.${name}: `, e);
} finally{
if (!keepSandboxAttached && sandbox?.parentNode) sandbox.parentNode.removeChild(sandbox);
}
}

@@ -22,0 +33,0 @@ if (!impl || !isFunction(impl)) return impl;

{
"name": "@posthog/browser-common",
"version": "0.2.4",
"version": "0.2.5",
"description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",

@@ -68,4 +68,4 @@ "license": "MIT",

"dependencies": {
"@posthog/core": "^1.45.1",
"@posthog/types": "^1.398.0"
"@posthog/core": "^1.45.3",
"@posthog/types": "^1.399.0"
},

@@ -76,2 +76,3 @@ "devDependencies": {

"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"ts-jest": "29.4.11",

@@ -78,0 +79,0 @@ "typescript": "5.8.2",