@oxvo/browser 7.1.0 → 7.3.4

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.
Files changed (68) hide show
  1. package/README.md +32 -0
  2. package/dist/cjs/common/interaction.d.ts +12 -1
  3. package/dist/cjs/common/messages.gen.d.ts +4 -7
  4. package/dist/cjs/entry.js +2382 -1191
  5. package/dist/cjs/entry.js.map +1 -1
  6. package/dist/cjs/index.js +2329 -1179
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/main/app/canvas.d.ts +13 -0
  9. package/dist/cjs/main/app/cross_domain_iframe.d.ts +44 -0
  10. package/dist/cjs/main/app/index.d.ts +63 -15
  11. package/dist/cjs/main/app/messages.gen.d.ts +2 -1
  12. package/dist/cjs/main/app/observer/observer.d.ts +16 -0
  13. package/dist/cjs/main/app/sanitizer.d.ts +5 -3
  14. package/dist/cjs/main/app/session.d.ts +1 -0
  15. package/dist/cjs/main/entry.d.ts +5 -5
  16. package/dist/cjs/main/index.d.ts +17 -1
  17. package/dist/cjs/main/modules/analytics/batcher.d.ts +6 -1
  18. package/dist/cjs/main/modules/analytics/index.d.ts +10 -0
  19. package/dist/cjs/main/modules/input.d.ts +2 -1
  20. package/dist/cjs/main/modules/markerWatcher.d.ts +4 -8
  21. package/dist/cjs/main/modules/mouse.d.ts +1 -0
  22. package/dist/cjs/main/modules/tagMatcher.d.ts +28 -0
  23. package/dist/cjs/main/singleton.d.ts +24 -0
  24. package/dist/cjs/main/utils.d.ts +2 -0
  25. package/dist/cjs/package.json +1 -0
  26. package/dist/lib/common/interaction.d.ts +12 -1
  27. package/dist/lib/common/messages.gen.d.ts +4 -7
  28. package/dist/lib/entry.js +2382 -1191
  29. package/dist/lib/entry.js.map +1 -1
  30. package/dist/lib/index.js +2329 -1179
  31. package/dist/lib/index.js.map +1 -1
  32. package/dist/lib/main/app/canvas.d.ts +13 -0
  33. package/dist/lib/main/app/cross_domain_iframe.d.ts +44 -0
  34. package/dist/lib/main/app/index.d.ts +63 -15
  35. package/dist/lib/main/app/messages.gen.d.ts +2 -1
  36. package/dist/lib/main/app/observer/observer.d.ts +16 -0
  37. package/dist/lib/main/app/sanitizer.d.ts +5 -3
  38. package/dist/lib/main/app/session.d.ts +1 -0
  39. package/dist/lib/main/entry.d.ts +5 -5
  40. package/dist/lib/main/index.d.ts +17 -1
  41. package/dist/lib/main/modules/analytics/batcher.d.ts +6 -1
  42. package/dist/lib/main/modules/analytics/index.d.ts +10 -0
  43. package/dist/lib/main/modules/input.d.ts +2 -1
  44. package/dist/lib/main/modules/markerWatcher.d.ts +4 -8
  45. package/dist/lib/main/modules/mouse.d.ts +1 -0
  46. package/dist/lib/main/modules/tagMatcher.d.ts +28 -0
  47. package/dist/lib/main/singleton.d.ts +24 -0
  48. package/dist/lib/main/utils.d.ts +2 -0
  49. package/dist/types/common/interaction.d.ts +12 -1
  50. package/dist/types/common/messages.gen.d.ts +4 -7
  51. package/dist/types/main/app/canvas.d.ts +13 -0
  52. package/dist/types/main/app/cross_domain_iframe.d.ts +44 -0
  53. package/dist/types/main/app/index.d.ts +63 -15
  54. package/dist/types/main/app/messages.gen.d.ts +2 -1
  55. package/dist/types/main/app/observer/observer.d.ts +16 -0
  56. package/dist/types/main/app/sanitizer.d.ts +5 -3
  57. package/dist/types/main/app/session.d.ts +1 -0
  58. package/dist/types/main/entry.d.ts +5 -5
  59. package/dist/types/main/index.d.ts +17 -1
  60. package/dist/types/main/modules/analytics/batcher.d.ts +6 -1
  61. package/dist/types/main/modules/analytics/index.d.ts +10 -0
  62. package/dist/types/main/modules/input.d.ts +2 -1
  63. package/dist/types/main/modules/markerWatcher.d.ts +4 -8
  64. package/dist/types/main/modules/mouse.d.ts +1 -0
  65. package/dist/types/main/modules/tagMatcher.d.ts +28 -0
  66. package/dist/types/main/singleton.d.ts +24 -0
  67. package/dist/types/main/utils.d.ts +2 -0
  68. package/package.json +14 -14
package/README.md CHANGED
@@ -29,6 +29,38 @@ await browser.start({
29
29
  });
30
30
  ```
31
31
 
32
+ ## Cross-Origin Iframes
33
+
34
+ Cross-origin iframe capture is opt-in on both pages. The top-level tracker must
35
+ allowlist every exact child origin, and each child tracker must name its exact
36
+ parent origin:
37
+
38
+ ```ts
39
+ // Top-level page at https://www.example.com
40
+ const parentBrowser = new Browser({
41
+ siteKey: 'ws_live_01HZX8M4B3',
42
+ crossdomain: {
43
+ enabled: true,
44
+ childOrigins: ['https://checkout.example.com'],
45
+ },
46
+ });
47
+ await parentBrowser.start();
48
+
49
+ // Embedded page at https://checkout.example.com
50
+ const childBrowser = new Browser({
51
+ siteKey: 'ws_live_01HZX8M4B3',
52
+ crossdomain: {
53
+ enabled: true,
54
+ parentDomain: 'https://www.example.com',
55
+ },
56
+ });
57
+ await childBrowser.start();
58
+ ```
59
+
60
+ Wildcards and opaque origins are rejected. Parent and child pages must use the
61
+ same current tracker release; legacy and mixed cross-frame protocols fail
62
+ closed.
63
+
32
64
  ## Common Runtime Calls
33
65
 
34
66
  ```ts
@@ -1,4 +1,5 @@
1
1
  import Message from './messages.gen.js';
2
+ export type DataType = 'player' | 'assets' | 'devtools' | 'analytics';
2
3
  export interface Options {
3
4
  connAttemptCount?: number;
4
5
  connAttemptGap?: number;
@@ -10,18 +11,22 @@ type Start = {
10
11
  timestamp: number;
11
12
  url: string;
12
13
  tabId: string;
14
+ localDebug?: boolean;
13
15
  } & Options;
14
16
  type Auth = {
15
17
  type: 'auth';
16
18
  token: string;
17
19
  beaconSizeLimit?: number;
20
+ protocolVersion?: number;
18
21
  };
19
22
  export type ToWorkerData = null | 'stop' | Start | Auth | Array<Message> | {
20
23
  type: 'compressed';
21
24
  batch: Uint8Array;
25
+ dataType: DataType;
22
26
  } | {
23
27
  type: 'uncompressed';
24
28
  batch: Uint8Array;
29
+ dataType: DataType;
25
30
  } | 'forceFlushBatch' | 'closing' | 'check_queue';
26
31
  type Failure = {
27
32
  type: 'failure';
@@ -30,8 +35,14 @@ type Failure = {
30
35
  type QEmpty = {
31
36
  type: 'queue_empty';
32
37
  };
38
+ type LocalSave = {
39
+ type: 'local_save';
40
+ name: string;
41
+ batch: Uint8Array;
42
+ };
33
43
  export type FromWorkerData = 'a_stop' | 'a_start' | Failure | 'not_init' | {
34
44
  type: 'compress';
35
45
  batch: Uint8Array;
36
- } | QEmpty;
46
+ dataType: DataType;
47
+ } | QEmpty | LocalSave;
37
48
  export {};
@@ -61,7 +61,6 @@ export declare const enum Type {
61
61
  JSException = 78,
62
62
  Zustand = 79,
63
63
  BatchMetadata = 81,
64
- PartitionedMessage = 82,
65
64
  NetworkRequest = 83,
66
65
  WSChannel = 84,
67
66
  ResourceTiming = 85,
@@ -442,11 +441,6 @@ export type BatchMetadata = [
442
441
  number,
443
442
  string
444
443
  ];
445
- export type PartitionedMessage = [
446
- Type.PartitionedMessage,
447
- number,
448
- number
449
- ];
450
444
  export type NetworkRequest = [
451
445
  Type.NetworkRequest,
452
446
  string,
@@ -583,5 +577,8 @@ export type WebVitals = [
583
577
  string,
584
578
  string
585
579
  ];
586
- type Message = Timestamp | SetPageLocationDeprecated | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequestDeprecated | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | StringDictGlobal | SetNodeAttributeDictGlobal | NodeAnimationResult | Profiler | OTable | StateAction | ReduxDeprecated | Vuex | MobX | NgRx | GraphQLDeprecated | PerformanceTrack | StringDictDeprecated | SetNodeAttributeDictDeprecated | StringDict | SetNodeAttributeDict | ResourceTimingDeprecatedDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | SetNodeSlot | MouseClick | MouseClickDeprecated | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage | NetworkRequest | WSChannel | ResourceTiming | Incident | LongAnimationTask | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTimingDeprecated | TabChange | TabData | CanvasNode | TagTrigger | Redux | SetPageLocation | GraphQL | WebVitals;
580
+ export declare const ASSET_MESSAGES: ReadonlySet<number>;
581
+ export declare const DEVTOOLS_MESSAGES: ReadonlySet<number>;
582
+ export declare const ANALYTICS_MESSAGES: ReadonlySet<number>;
583
+ type Message = Timestamp | SetPageLocationDeprecated | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequestDeprecated | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | StringDictGlobal | SetNodeAttributeDictGlobal | NodeAnimationResult | Profiler | OTable | StateAction | ReduxDeprecated | Vuex | MobX | NgRx | GraphQLDeprecated | PerformanceTrack | StringDictDeprecated | SetNodeAttributeDictDeprecated | StringDict | SetNodeAttributeDict | ResourceTimingDeprecatedDeprecated | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | SetNodeSlot | MouseClick | MouseClickDeprecated | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | NetworkRequest | WSChannel | ResourceTiming | Incident | LongAnimationTask | InputChange | SelectionChange | MouseThrashing | UnbindNodes | ResourceTimingDeprecated | TabChange | TabData | CanvasNode | TagTrigger | Redux | SetPageLocation | GraphQL | WebVitals;
587
584
  export default Message;