@corbado/observe 1.10.0 → 1.10.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/analysis/client.mjs +0 -10
- package/dist/analysis/config.mjs +1 -4
- package/dist/analysis/device.mjs +0 -79
- package/dist/analysis/low-events/grouped-input-tracker.mjs +2 -3
- package/dist/analysis/low-events/input-change-recorder.mjs +35 -12
- package/dist/analysis/low-events/input-tracker.mjs +0 -58
- package/dist/analysis/readers/network.mjs +5 -0
- package/dist/analysis/transports/fetch.mjs +16 -1
- package/dist/analysis/utils/operation-full.mjs +0 -1
- package/dist/analysis/version.mjs +1 -1
- package/dist/cdn/script.global.js +4 -4
- package/dist/index.d.mts +6 -28
- package/dist/index.d.ts +6 -28
- package/dist/index.js +4 -4
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/analysis/readers/password-manager-dom.mjs +0 -112
package/package.json
CHANGED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// src/readers/password-manager-dom.ts
|
|
2
|
-
var SIGNAL_TAG_QUERIES = [
|
|
3
|
-
{ query: "com-1password-button", eventType: "pa-1" },
|
|
4
|
-
{ query: "com-1password-menu", eventType: "pa-2" },
|
|
5
|
-
{ query: "com-1password-notification", eventType: "pa-3" }
|
|
6
|
-
];
|
|
7
|
-
var SIGNAL_ATTR_SELECTOR = "[data-lastpass-root], [data-lp], [data-lpignore], [data-lpfieldtype]";
|
|
8
|
-
var SIGNAL_ATTR_EVENT_TYPE = "pa-4";
|
|
9
|
-
var POPOVER_MANUAL_SELECTOR = '[popover="manual"]';
|
|
10
|
-
var PROFILE_A_MIN_STYLE_LENGTH = 400;
|
|
11
|
-
var PROFILE_A_MIN_INITIAL_IMPORTANT = 20;
|
|
12
|
-
var PROFILE_A_EVENT_TYPE = "pa-5";
|
|
13
|
-
var PROFILE_B_EVENT_TYPE = "pa-6";
|
|
14
|
-
var safeQueryAll = (root, selector) => {
|
|
15
|
-
try {
|
|
16
|
-
return Array.from(root.querySelectorAll(selector));
|
|
17
|
-
} catch {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var isPopoverProfileA = (el) => {
|
|
22
|
-
if (el.getAttribute("popover") !== "manual") {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
const style = el.getAttribute("style") ?? "";
|
|
26
|
-
if (style.length < PROFILE_A_MIN_STYLE_LENGTH) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
if (!/z-index:\s*2147483647\b/i.test(style)) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
if (!/position:\s*fixed\b/i.test(style)) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
if (!/display:\s*block\b/i.test(style)) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
const initialImportantHits = style.match(/initial\s*!important/gi);
|
|
39
|
-
if ((initialImportantHits?.length ?? 0) < PROFILE_A_MIN_INITIAL_IMPORTANT) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
return true;
|
|
43
|
-
};
|
|
44
|
-
var isPopoverProfileB = (el) => {
|
|
45
|
-
if (isPopoverProfileA(el)) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
if (el.getAttribute("popover") !== "manual") {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
const style = el.getAttribute("style") ?? "";
|
|
52
|
-
if (!/z-index:\s*2147483647\b/i.test(style)) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
if (!/position:\s*fixed\b/i.test(style)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
if (!/backdrop-filter:\s*[^;]*blur\(\s*20px\s*\)/i.test(style)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
if (!/background-color:\s*rgba\(\s*35\s*,\s*35\s*,\s*35\s*,/i.test(style)) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
return true;
|
|
65
|
-
};
|
|
66
|
-
var forEachScanRoot = (cb) => {
|
|
67
|
-
cb(document);
|
|
68
|
-
for (const host of Array.from(document.querySelectorAll("*"))) {
|
|
69
|
-
const shadowRoot = host.shadowRoot;
|
|
70
|
-
if (shadowRoot) {
|
|
71
|
-
cb(shadowRoot);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
var scanInputEnvSignals = () => {
|
|
76
|
-
const matched = /* @__PURE__ */ new Set();
|
|
77
|
-
if (typeof document === "undefined") {
|
|
78
|
-
return matched;
|
|
79
|
-
}
|
|
80
|
-
forEachScanRoot((root) => {
|
|
81
|
-
for (const entry of SIGNAL_TAG_QUERIES) {
|
|
82
|
-
if (matched.has(entry.eventType)) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
if (safeQueryAll(root, entry.query).length > 0) {
|
|
86
|
-
matched.add(entry.eventType);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (!matched.has(SIGNAL_ATTR_EVENT_TYPE) && safeQueryAll(root, SIGNAL_ATTR_SELECTOR).length > 0) {
|
|
90
|
-
matched.add(SIGNAL_ATTR_EVENT_TYPE);
|
|
91
|
-
}
|
|
92
|
-
if (!matched.has(PROFILE_A_EVENT_TYPE) || !matched.has(PROFILE_B_EVENT_TYPE)) {
|
|
93
|
-
for (const el of safeQueryAll(root, POPOVER_MANUAL_SELECTOR)) {
|
|
94
|
-
if (!matched.has(PROFILE_A_EVENT_TYPE) && isPopoverProfileA(el)) {
|
|
95
|
-
matched.add(PROFILE_A_EVENT_TYPE);
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
if (!matched.has(PROFILE_B_EVENT_TYPE) && isPopoverProfileB(el)) {
|
|
99
|
-
matched.add(PROFILE_B_EVENT_TYPE);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return matched;
|
|
105
|
-
};
|
|
106
|
-
function readPasswordManagerDomSignals(_meta) {
|
|
107
|
-
return scanInputEnvSignals();
|
|
108
|
-
}
|
|
109
|
-
export {
|
|
110
|
-
readPasswordManagerDomSignals,
|
|
111
|
-
scanInputEnvSignals
|
|
112
|
-
};
|