@posthog/browser-common 0.7.3 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +1 -1
- package/dist/config.mjs +1 -1
- package/dist/utils/autocapture-utils.d.ts +2 -0
- package/dist/utils/autocapture-utils.js +6 -0
- package/dist/utils/autocapture-utils.mjs +1 -1
- package/dist/utils/event-utils.js +3 -0
- package/dist/utils/event-utils.mjs +4 -1
- package/package.json +2 -2
package/dist/config.js
CHANGED
package/dist/config.mjs
CHANGED
|
@@ -7,7 +7,9 @@ export declare function makeSafeText(s: string | null | undefined): string | nul
|
|
|
7
7
|
export declare function getSafeText(el: Element): string;
|
|
8
8
|
export declare function getEventTarget(e: Event): Element | null;
|
|
9
9
|
export declare const autocaptureCompatibleElements: string[];
|
|
10
|
+
export declare function elementMatchesCSSSelector(el: Element, selector: string): boolean;
|
|
10
11
|
export declare function getParentElement(curEl: Element): Element | false;
|
|
12
|
+
export declare const DEFAULT_AUTOCAPTURE_IGNORE_LIST: string[];
|
|
11
13
|
export declare const DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS: string[];
|
|
12
14
|
export declare function shouldCaptureDeadClick(el: Element | null, _config: PostHogConfig['capture_dead_clicks']): boolean;
|
|
13
15
|
export declare function isTextSelectionTarget(el: Element | null): boolean;
|
|
@@ -28,9 +28,11 @@ var __webpack_require__ = {};
|
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
DEFAULT_AUTOCAPTURE_IGNORE_LIST: ()=>DEFAULT_AUTOCAPTURE_IGNORE_LIST,
|
|
31
32
|
DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS: ()=>DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS,
|
|
32
33
|
MAX_DOM_ANCESTOR_DEPTH: ()=>MAX_DOM_ANCESTOR_DEPTH,
|
|
33
34
|
autocaptureCompatibleElements: ()=>autocaptureCompatibleElements,
|
|
35
|
+
elementMatchesCSSSelector: ()=>elementMatchesCSSSelector,
|
|
34
36
|
getClassNames: ()=>getClassNames,
|
|
35
37
|
getDirectAndNestedSpanText: ()=>getDirectAndNestedSpanText,
|
|
36
38
|
getElementsChainString: ()=>getElementsChainString,
|
|
@@ -488,9 +490,11 @@ function extractAttrClass(el) {
|
|
|
488
490
|
if ((0, core_namespaceObject.isArray)(attr_class)) return attr_class;
|
|
489
491
|
return splitClassString(attr_class);
|
|
490
492
|
}
|
|
493
|
+
exports.DEFAULT_AUTOCAPTURE_IGNORE_LIST = __webpack_exports__.DEFAULT_AUTOCAPTURE_IGNORE_LIST;
|
|
491
494
|
exports.DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS = __webpack_exports__.DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS;
|
|
492
495
|
exports.MAX_DOM_ANCESTOR_DEPTH = __webpack_exports__.MAX_DOM_ANCESTOR_DEPTH;
|
|
493
496
|
exports.autocaptureCompatibleElements = __webpack_exports__.autocaptureCompatibleElements;
|
|
497
|
+
exports.elementMatchesCSSSelector = __webpack_exports__.elementMatchesCSSSelector;
|
|
494
498
|
exports.getClassNames = __webpack_exports__.getClassNames;
|
|
495
499
|
exports.getDirectAndNestedSpanText = __webpack_exports__.getDirectAndNestedSpanText;
|
|
496
500
|
exports.getElementsChainString = __webpack_exports__.getElementsChainString;
|
|
@@ -510,9 +514,11 @@ exports.shouldCaptureValue = __webpack_exports__.shouldCaptureValue;
|
|
|
510
514
|
exports.shouldSkipDeadClick = __webpack_exports__.shouldSkipDeadClick;
|
|
511
515
|
exports.splitClassString = __webpack_exports__.splitClassString;
|
|
512
516
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
517
|
+
"DEFAULT_AUTOCAPTURE_IGNORE_LIST",
|
|
513
518
|
"DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS",
|
|
514
519
|
"MAX_DOM_ANCESTOR_DEPTH",
|
|
515
520
|
"autocaptureCompatibleElements",
|
|
521
|
+
"elementMatchesCSSSelector",
|
|
516
522
|
"getClassNames",
|
|
517
523
|
"getDirectAndNestedSpanText",
|
|
518
524
|
"getElementsChainString",
|
|
@@ -436,4 +436,4 @@ function extractAttrClass(el) {
|
|
|
436
436
|
if (isArray(attr_class)) return attr_class;
|
|
437
437
|
return splitClassString(attr_class);
|
|
438
438
|
}
|
|
439
|
-
export { DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS, MAX_DOM_ANCESTOR_DEPTH, autocaptureCompatibleElements, getClassNames, getDirectAndNestedSpanText, getElementsChainString, getEventTarget, getNestedSpanText, getParentElement, getSafeText, isAngularStyleAttr, isSensitiveElement, isTextSelectionTarget, makeSafeText, shouldCaptureDeadClick, shouldCaptureDomEvent, shouldCaptureElement, shouldCaptureRageclick, shouldCaptureValue, shouldSkipDeadClick, splitClassString };
|
|
439
|
+
export { DEFAULT_AUTOCAPTURE_IGNORE_LIST, DEFAULT_CONTENT_IGNORELIST_WITH_STEPPERS, MAX_DOM_ANCESTOR_DEPTH, autocaptureCompatibleElements, elementMatchesCSSSelector, getClassNames, getDirectAndNestedSpanText, getElementsChainString, getEventTarget, getNestedSpanText, getParentElement, getSafeText, isAngularStyleAttr, isSensitiveElement, isTextSelectionTarget, makeSafeText, shouldCaptureDeadClick, shouldCaptureDomEvent, shouldCaptureElement, shouldCaptureRageclick, shouldCaptureValue, shouldSkipDeadClick, splitClassString };
|
|
@@ -261,6 +261,7 @@ function getEventProperties(maskPersonalDataProperties, customPersonalDataProper
|
|
|
261
261
|
...customPersonalDataProperties || []
|
|
262
262
|
] : [];
|
|
263
263
|
const [os_name, os_version] = (0, core_namespaceObject.detectOS)(external_globals_js_namespaceObject.userAgent);
|
|
264
|
+
const [webviewApp, webviewAppVersion] = (0, core_namespaceObject.detectWebviewApp)(external_globals_js_namespaceObject.userAgent);
|
|
264
265
|
const browserHints = getBrowserDetectionHints();
|
|
265
266
|
const browserOptions = {};
|
|
266
267
|
if (!(0, core_namespaceObject.isUndefined)(detectGoogleSearchApp)) browserOptions.detectGoogleSearchApp = detectGoogleSearchApp;
|
|
@@ -279,6 +280,8 @@ function getEventProperties(maskPersonalDataProperties, customPersonalDataProper
|
|
|
279
280
|
$os: os_name,
|
|
280
281
|
$os_version: os_version,
|
|
281
282
|
$browser: (0, core_namespaceObject.detectBrowser)(external_globals_js_namespaceObject.userAgent, navigator.vendor, browserHints, browserOptions),
|
|
283
|
+
$webview_app: webviewApp,
|
|
284
|
+
$webview_app_version: webviewAppVersion,
|
|
282
285
|
$device: (0, core_namespaceObject.detectDevice)(external_globals_js_namespaceObject.userAgent),
|
|
283
286
|
$device_type: (0, core_namespaceObject.detectDeviceType)(external_globals_js_namespaceObject.userAgent, deviceOptions),
|
|
284
287
|
$timezone: getTimezone(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertToURL, getQueryParam, maskQueryParams } from "./request-utils.mjs";
|
|
2
|
-
import { detectBrowser, detectBrowserVersion, detectDevice, detectDeviceType, detectOS, isNull, isUndefined, stripLeadingDollar, stripUrlHash } from "@posthog/core";
|
|
2
|
+
import { detectBrowser, detectBrowserVersion, detectDevice, detectDeviceType, detectOS, detectWebviewApp, isNull, isUndefined, stripLeadingDollar, stripUrlHash } from "@posthog/core";
|
|
3
3
|
import config from "../config.mjs";
|
|
4
4
|
import { SDK_DIST_CHANNEL } from "../constants.mjs";
|
|
5
5
|
import { each, extend, stripEmptyProperties } from "./general-utils.mjs";
|
|
@@ -201,6 +201,7 @@ function getEventProperties(maskPersonalDataProperties, customPersonalDataProper
|
|
|
201
201
|
...customPersonalDataProperties || []
|
|
202
202
|
] : [];
|
|
203
203
|
const [os_name, os_version] = detectOS(userAgent);
|
|
204
|
+
const [webviewApp, webviewAppVersion] = detectWebviewApp(userAgent);
|
|
204
205
|
const browserHints = getBrowserDetectionHints();
|
|
205
206
|
const browserOptions = {};
|
|
206
207
|
if (!isUndefined(detectGoogleSearchApp)) browserOptions.detectGoogleSearchApp = detectGoogleSearchApp;
|
|
@@ -219,6 +220,8 @@ function getEventProperties(maskPersonalDataProperties, customPersonalDataProper
|
|
|
219
220
|
$os: os_name,
|
|
220
221
|
$os_version: os_version,
|
|
221
222
|
$browser: detectBrowser(userAgent, navigator.vendor, browserHints, browserOptions),
|
|
223
|
+
$webview_app: webviewApp,
|
|
224
|
+
$webview_app_version: webviewAppVersion,
|
|
222
225
|
$device: detectDevice(userAgent),
|
|
223
226
|
$device_type: detectDeviceType(userAgent, deviceOptions),
|
|
224
227
|
$timezone: getTimezone(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@posthog/browser-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Internal shared browser utilities and extension primitives for PostHog Browser SDKs",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@posthog/core": "^1.
|
|
76
|
+
"@posthog/core": "^1.51.0",
|
|
77
77
|
"@posthog/types": "^1.409.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|