@datadog/browser-rum-shopify 7.9.0 → 7.10.0

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.
@@ -1,17 +1 @@
1
- /**
2
- * A Shopify Custom Pixel runs in a "lax" sandboxed iframe (`sandbox="allow-scripts"`, no
3
- * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an
4
- * opaque/`null` origin for its own window/document. Several browser APIs the RUM SDK relies on
5
- * either don't work there or throw synchronously in ways the SDK doesn't fully guard against,
6
- * which silently breaks session tracking and view/URL resolution:
7
- * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.
8
- * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is
9
- * denied without Permissions Policy delegation), but the SDK only catches an async rejection.
10
- * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that
11
- * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.
12
- * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can
13
- * never hold browser focus regardless of whether the customer is actively looking at the page.
14
- * Shimming these away makes the SDK fall back to code paths that do work in this context
15
- * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).
16
- */
17
1
  export declare function patchSandboxedIframeApis(): void;
@@ -1,4 +1,4 @@
1
- let _datadog_browser_core = require("@datadog/browser-core");
1
+ let _datadog_js_core_util = require("@datadog/js-core/util");
2
2
  //#region src/boot/patchSandboxedIframeApis.ts
3
3
  /**
4
4
  * A Shopify Custom Pixel runs in a "lax" sandboxed iframe (`sandbox="allow-scripts"`, no
@@ -9,22 +9,14 @@ let _datadog_browser_core = require("@datadog/browser-core");
9
9
  * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.
10
10
  * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is
11
11
  * denied without Permissions Policy delegation), but the SDK only catches an async rejection.
12
- * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that
13
- * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.
14
12
  * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can
15
13
  * never hold browser focus regardless of whether the customer is actively looking at the page.
16
14
  * Shimming these away makes the SDK fall back to code paths that do work in this context
17
15
  * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).
18
16
  */
19
17
  function patchSandboxedIframeApis() {
20
- disableProperty(_datadog_browser_core.globalObject, "cookieStore");
18
+ disableProperty(_datadog_js_core_util.globalObject, "cookieStore");
21
19
  disableProperty(navigator, "locks");
22
- Object.defineProperty(HTMLIFrameElement.prototype, "contentWindow", {
23
- get() {
24
- return null;
25
- },
26
- configurable: true
27
- });
28
20
  Object.defineProperty(document, "hasFocus", {
29
21
  value: () => true,
30
22
  configurable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"patchSandboxedIframeApis.js","names":["globalObject"],"sources":["../../src/boot/patchSandboxedIframeApis.ts"],"sourcesContent":["import { globalObject } from '@datadog/browser-core'\n\n/**\n * A Shopify Custom Pixel runs in a \"lax\" sandboxed iframe (`sandbox=\"allow-scripts\"`, no\n * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an\n * opaque/`null` origin for its own window/document. Several browser APIs the RUM SDK relies on\n * either don't work there or throw synchronously in ways the SDK doesn't fully guard against,\n * which silently breaks session tracking and view/URL resolution:\n * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.\n * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is\n * denied without Permissions Policy delegation), but the SDK only catches an async rejection.\n * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that\n * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.\n * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can\n * never hold browser focus regardless of whether the customer is actively looking at the page.\n * Shimming these away makes the SDK fall back to code paths that do work in this context\n * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).\n */\nexport function patchSandboxedIframeApis() {\n disableProperty(globalObject, 'cookieStore')\n disableProperty(navigator, 'locks')\n\n Object.defineProperty(HTMLIFrameElement.prototype, 'contentWindow', {\n get() {\n return null\n },\n configurable: true,\n })\n\n Object.defineProperty(document, 'hasFocus', {\n value: () => true,\n configurable: true,\n writable: true,\n })\n}\n\nfunction disableProperty(target: object, key: string) {\n Object.defineProperty(target, key, {\n value: undefined,\n configurable: true,\n writable: true,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,2BAA2B;CACzC,gBAAgBA,sBAAAA,cAAc,aAAa;CAC3C,gBAAgB,WAAW,OAAO;CAElC,OAAO,eAAe,kBAAkB,WAAW,iBAAiB;EAClE,MAAM;GACJ,OAAO;EACT;EACA,cAAc;CAChB,CAAC;CAED,OAAO,eAAe,UAAU,YAAY;EAC1C,aAAa;EACb,cAAc;EACd,UAAU;CACZ,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAgB,KAAa;CACpD,OAAO,eAAe,QAAQ,KAAK;EACjC,OAAO,KAAA;EACP,cAAc;EACd,UAAU;CACZ,CAAC;AACH"}
1
+ {"version":3,"file":"patchSandboxedIframeApis.js","names":["globalObject"],"sources":["../../src/boot/patchSandboxedIframeApis.ts"],"sourcesContent":["/**\n * A Shopify Custom Pixel runs in a \"lax\" sandboxed iframe (`sandbox=\"allow-scripts\"`, no\n * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an\n * opaque/`null` origin for its own window/document. Several browser APIs the RUM SDK relies on\n * either don't work there or throw synchronously in ways the SDK doesn't fully guard against,\n * which silently breaks session tracking and view/URL resolution:\n * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.\n * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is\n * denied without Permissions Policy delegation), but the SDK only catches an async rejection.\n * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can\n * never hold browser focus regardless of whether the customer is actively looking at the page.\n * Shimming these away makes the SDK fall back to code paths that do work in this context\n * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).\n */\nimport { globalObject } from '@datadog/js-core/util'\nexport function patchSandboxedIframeApis() {\n disableProperty(globalObject, 'cookieStore')\n disableProperty(navigator, 'locks')\n\n Object.defineProperty(document, 'hasFocus', {\n value: () => true,\n configurable: true,\n writable: true,\n })\n}\n\nfunction disableProperty(target: object, key: string) {\n Object.defineProperty(target, key, {\n value: undefined,\n configurable: true,\n writable: true,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAgB,2BAA2B;CACzC,gBAAgBA,sBAAAA,cAAc,aAAa;CAC3C,gBAAgB,WAAW,OAAO;CAElC,OAAO,eAAe,UAAU,YAAY;EAC1C,aAAa;EACb,cAAc;EACd,UAAU;CACZ,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAgB,KAAa;CACpD,OAAO,eAAe,QAAQ,KAAK;EACjC,OAAO,KAAA;EACP,cAAc;EACd,UAAU;CACZ,CAAC;AACH"}
@@ -1,9 +1,10 @@
1
1
  const require_makeShopifyRumPublicApi = require("../boot/makeShopifyRumPublicApi.js");
2
+ let _datadog_js_core_util = require("@datadog/js-core/util");
2
3
  let _datadog_browser_core = require("@datadog/browser-core");
3
4
  let _datadog_browser_rum_core = require("@datadog/browser-rum-core");
4
5
  let _datadog_browser_rum_internal = require("@datadog/browser-rum/internal");
5
6
  //#region src/entries/main.ts
6
- const global = _datadog_browser_core.globalObject;
7
+ const global = _datadog_js_core_util.globalObject;
7
8
  const datadogRum = require_makeShopifyRumPublicApi.makeShopifyRumPublicApi((0, _datadog_browser_rum_core.makeRumPublicApi)((0, _datadog_browser_rum_internal.makeRecorderApi)(), (0, _datadog_browser_rum_internal.makeProfilerApi)(), { sdkName: "rum-shopify" }));
8
9
  (0, _datadog_browser_core.defineGlobal)(global, "DD_RUM", datadogRum);
9
10
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","names":["globalObject","makeShopifyRumPublicApi","makeRumPublicApi","makeRecorderApi","makeProfilerApi","defineGlobal"],"sources":["../../src/entries/main.ts"],"sourcesContent":["import { defineGlobal, globalObject } from '@datadog/browser-core'\nimport type { RumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRecorderApi, makeProfilerApi } from '@datadog/browser-rum/internal'\nimport { makeShopifyRumPublicApi } from '../boot/makeShopifyRumPublicApi'\n\ninterface BrowserWindow {\n DD_RUM?: RumPublicApi\n}\n\nconst global = globalObject as BrowserWindow\n\nconst datadogRum = makeShopifyRumPublicApi(\n makeRumPublicApi(makeRecorderApi(), makeProfilerApi(), {\n sdkName: 'rum-shopify',\n })\n)\n\ndefineGlobal(global, 'DD_RUM', datadogRum)\n"],"mappings":";;;;;AAUA,MAAM,SAASA,sBAAAA;AAEf,MAAM,aAAaC,gCAAAA,yBAAAA,GACjBC,0BAAAA,iBAAAA,EAAAA,GAAiBC,8BAAAA,gBAAAA,CAAgB,IAAA,GAAGC,8BAAAA,gBAAAA,CAAgB,GAAG,EACrD,SAAS,cACX,CAAC,CACH;CAEAC,GAAAA,sBAAAA,aAAAA,CAAa,QAAQ,UAAU,UAAU"}
1
+ {"version":3,"file":"main.js","names":["globalObject","makeShopifyRumPublicApi","makeRumPublicApi","makeRecorderApi","makeProfilerApi","defineGlobal"],"sources":["../../src/entries/main.ts"],"sourcesContent":["import { globalObject } from '@datadog/js-core/util'\nimport { defineGlobal } from '@datadog/browser-core'\nimport type { RumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRecorderApi, makeProfilerApi } from '@datadog/browser-rum/internal'\nimport { makeShopifyRumPublicApi } from '../boot/makeShopifyRumPublicApi'\n\ninterface BrowserWindow {\n DD_RUM?: RumPublicApi\n}\n\nconst global = globalObject as BrowserWindow\n\nconst datadogRum = makeShopifyRumPublicApi(\n makeRumPublicApi(makeRecorderApi(), makeProfilerApi(), {\n sdkName: 'rum-shopify',\n })\n)\n\ndefineGlobal(global, 'DD_RUM', datadogRum)\n"],"mappings":";;;;;;AAWA,MAAM,SAASA,sBAAAA;AAEf,MAAM,aAAaC,gCAAAA,yBAAAA,GACjBC,0BAAAA,iBAAAA,EAAAA,GAAiBC,8BAAAA,gBAAAA,CAAgB,IAAA,GAAGC,8BAAAA,gBAAAA,CAAgB,GAAG,EACrD,SAAS,cACX,CAAC,CACH;CAEAC,GAAAA,sBAAAA,aAAAA,CAAa,QAAQ,UAAU,UAAU"}
@@ -1,4 +1,4 @@
1
- import { globalObject } from "@datadog/browser-core";
1
+ import { globalObject } from "@datadog/js-core/util";
2
2
  //#region src/boot/patchSandboxedIframeApis.ts
3
3
  /**
4
4
  * A Shopify Custom Pixel runs in a "lax" sandboxed iframe (`sandbox="allow-scripts"`, no
@@ -9,8 +9,6 @@ import { globalObject } from "@datadog/browser-core";
9
9
  * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.
10
10
  * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is
11
11
  * denied without Permissions Policy delegation), but the SDK only catches an async rejection.
12
- * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that
13
- * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.
14
12
  * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can
15
13
  * never hold browser focus regardless of whether the customer is actively looking at the page.
16
14
  * Shimming these away makes the SDK fall back to code paths that do work in this context
@@ -19,12 +17,6 @@ import { globalObject } from "@datadog/browser-core";
19
17
  function patchSandboxedIframeApis() {
20
18
  disableProperty(globalObject, "cookieStore");
21
19
  disableProperty(navigator, "locks");
22
- Object.defineProperty(HTMLIFrameElement.prototype, "contentWindow", {
23
- get() {
24
- return null;
25
- },
26
- configurable: true
27
- });
28
20
  Object.defineProperty(document, "hasFocus", {
29
21
  value: () => true,
30
22
  configurable: true,
@@ -1 +1 @@
1
- {"version":3,"file":"patchSandboxedIframeApis.mjs","names":[],"sources":["../../src/boot/patchSandboxedIframeApis.ts"],"sourcesContent":["import { globalObject } from '@datadog/browser-core'\n\n/**\n * A Shopify Custom Pixel runs in a \"lax\" sandboxed iframe (`sandbox=\"allow-scripts\"`, no\n * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an\n * opaque/`null` origin for its own window/document. Several browser APIs the RUM SDK relies on\n * either don't work there or throw synchronously in ways the SDK doesn't fully guard against,\n * which silently breaks session tracking and view/URL resolution:\n * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.\n * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is\n * denied without Permissions Policy delegation), but the SDK only catches an async rejection.\n * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that\n * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.\n * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can\n * never hold browser focus regardless of whether the customer is actively looking at the page.\n * Shimming these away makes the SDK fall back to code paths that do work in this context\n * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).\n */\nexport function patchSandboxedIframeApis() {\n disableProperty(globalObject, 'cookieStore')\n disableProperty(navigator, 'locks')\n\n Object.defineProperty(HTMLIFrameElement.prototype, 'contentWindow', {\n get() {\n return null\n },\n configurable: true,\n })\n\n Object.defineProperty(document, 'hasFocus', {\n value: () => true,\n configurable: true,\n writable: true,\n })\n}\n\nfunction disableProperty(target: object, key: string) {\n Object.defineProperty(target, key, {\n value: undefined,\n configurable: true,\n writable: true,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,2BAA2B;CACzC,gBAAgB,cAAc,aAAa;CAC3C,gBAAgB,WAAW,OAAO;CAElC,OAAO,eAAe,kBAAkB,WAAW,iBAAiB;EAClE,MAAM;GACJ,OAAO;EACT;EACA,cAAc;CAChB,CAAC;CAED,OAAO,eAAe,UAAU,YAAY;EAC1C,aAAa;EACb,cAAc;EACd,UAAU;CACZ,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAgB,KAAa;CACpD,OAAO,eAAe,QAAQ,KAAK;EACjC,OAAO,KAAA;EACP,cAAc;EACd,UAAU;CACZ,CAAC;AACH"}
1
+ {"version":3,"file":"patchSandboxedIframeApis.mjs","names":[],"sources":["../../src/boot/patchSandboxedIframeApis.ts"],"sourcesContent":["/**\n * A Shopify Custom Pixel runs in a \"lax\" sandboxed iframe (`sandbox=\"allow-scripts\"`, no\n * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an\n * opaque/`null` origin for its own window/document. Several browser APIs the RUM SDK relies on\n * either don't work there or throw synchronously in ways the SDK doesn't fully guard against,\n * which silently breaks session tracking and view/URL resolution:\n * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.\n * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is\n * denied without Permissions Policy delegation), but the SDK only catches an async rejection.\n * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can\n * never hold browser focus regardless of whether the customer is actively looking at the page.\n * Shimming these away makes the SDK fall back to code paths that do work in this context\n * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).\n */\nimport { globalObject } from '@datadog/js-core/util'\nexport function patchSandboxedIframeApis() {\n disableProperty(globalObject, 'cookieStore')\n disableProperty(navigator, 'locks')\n\n Object.defineProperty(document, 'hasFocus', {\n value: () => true,\n configurable: true,\n writable: true,\n })\n}\n\nfunction disableProperty(target: object, key: string) {\n Object.defineProperty(target, key, {\n value: undefined,\n configurable: true,\n writable: true,\n })\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAgB,2BAA2B;CACzC,gBAAgB,cAAc,aAAa;CAC3C,gBAAgB,WAAW,OAAO;CAElC,OAAO,eAAe,UAAU,YAAY;EAC1C,aAAa;EACb,cAAc;EACd,UAAU;CACZ,CAAC;AACH;AAEA,SAAS,gBAAgB,QAAgB,KAAa;CACpD,OAAO,eAAe,QAAQ,KAAK;EACjC,OAAO,KAAA;EACP,cAAc;EACd,UAAU;CACZ,CAAC;AACH"}
@@ -1,5 +1,6 @@
1
1
  import { makeShopifyRumPublicApi } from "../boot/makeShopifyRumPublicApi.mjs";
2
- import { defineGlobal, globalObject } from "@datadog/browser-core";
2
+ import { globalObject } from "@datadog/js-core/util";
3
+ import { defineGlobal } from "@datadog/browser-core";
3
4
  import { makeRumPublicApi } from "@datadog/browser-rum-core";
4
5
  import { makeProfilerApi, makeRecorderApi } from "@datadog/browser-rum/internal";
5
6
  //#region src/entries/main.ts
@@ -1 +1 @@
1
- {"version":3,"file":"main.mjs","names":[],"sources":["../../src/entries/main.ts"],"sourcesContent":["import { defineGlobal, globalObject } from '@datadog/browser-core'\nimport type { RumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRecorderApi, makeProfilerApi } from '@datadog/browser-rum/internal'\nimport { makeShopifyRumPublicApi } from '../boot/makeShopifyRumPublicApi'\n\ninterface BrowserWindow {\n DD_RUM?: RumPublicApi\n}\n\nconst global = globalObject as BrowserWindow\n\nconst datadogRum = makeShopifyRumPublicApi(\n makeRumPublicApi(makeRecorderApi(), makeProfilerApi(), {\n sdkName: 'rum-shopify',\n })\n)\n\ndefineGlobal(global, 'DD_RUM', datadogRum)\n"],"mappings":";;;;;AAUA,MAAM,SAAS;AAEf,MAAM,aAAa,wBACjB,iBAAiB,gBAAgB,GAAG,gBAAgB,GAAG,EACrD,SAAS,cACX,CAAC,CACH;AAEA,aAAa,QAAQ,UAAU,UAAU"}
1
+ {"version":3,"file":"main.mjs","names":[],"sources":["../../src/entries/main.ts"],"sourcesContent":["import { globalObject } from '@datadog/js-core/util'\nimport { defineGlobal } from '@datadog/browser-core'\nimport type { RumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRumPublicApi } from '@datadog/browser-rum-core'\nimport { makeRecorderApi, makeProfilerApi } from '@datadog/browser-rum/internal'\nimport { makeShopifyRumPublicApi } from '../boot/makeShopifyRumPublicApi'\n\ninterface BrowserWindow {\n DD_RUM?: RumPublicApi\n}\n\nconst global = globalObject as BrowserWindow\n\nconst datadogRum = makeShopifyRumPublicApi(\n makeRumPublicApi(makeRecorderApi(), makeProfilerApi(), {\n sdkName: 'rum-shopify',\n })\n)\n\ndefineGlobal(global, 'DD_RUM', datadogRum)\n"],"mappings":";;;;;;AAWA,MAAM,SAAS;AAEf,MAAM,aAAa,wBACjB,iBAAiB,gBAAgB,GAAG,gBAAgB,GAAG,EACrD,SAAS,cACX,CAAC,CACH;AAEA,aAAa,QAAQ,UAAU,UAAU"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datadog/browser-rum-shopify",
3
- "version": "7.9.0",
3
+ "version": "7.10.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "cjs/entries/main.js",
6
6
  "module": "esm/entries/main.mjs",
@@ -19,10 +19,10 @@
19
19
  "prepack": "yarn build"
20
20
  },
21
21
  "dependencies": {
22
- "@datadog/browser-core": "7.9.0",
23
- "@datadog/browser-rum": "7.9.0",
24
- "@datadog/browser-rum-core": "7.9.0",
25
- "@datadog/js-core": "0.0.10"
22
+ "@datadog/browser-core": "7.10.0",
23
+ "@datadog/browser-rum": "7.10.0",
24
+ "@datadog/browser-rum-core": "7.10.0",
25
+ "@datadog/js-core": "0.0.11"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
@@ -1,5 +1,3 @@
1
- import { globalObject } from '@datadog/browser-core'
2
-
3
1
  /**
4
2
  * A Shopify Custom Pixel runs in a "lax" sandboxed iframe (`sandbox="allow-scripts"`, no
5
3
  * `allow-same-origin`): it shares the parent page's cookie jar (same domain) but has an
@@ -9,24 +7,16 @@ import { globalObject } from '@datadog/browser-core'
9
7
  * - `cookieStore.getAll()` is blocked; `document.cookie` works fine as a fallback.
10
8
  * - `navigator.locks.request()` throws a synchronous `SecurityError` (the Web Locks API is
11
9
  * denied without Permissions Policy delegation), but the SDK only catches an async rejection.
12
- * - `getPristineWindow()` creates a nested iframe to read an unpatched `URL` constructor; that
13
- * nested iframe's `contentWindow` is cross-origin here, and reading a property off it throws.
14
10
  * - `document.hasFocus()` always returns `false`: the pixel iframe has no focusable UI, so it can
15
11
  * never hold browser focus regardless of whether the customer is actively looking at the page.
16
12
  * Shimming these away makes the SDK fall back to code paths that do work in this context
17
13
  * (`document.cookie`, same-document promise chaining, `globalObject.URL`, always-focused state).
18
14
  */
15
+ import { globalObject } from '@datadog/js-core/util'
19
16
  export function patchSandboxedIframeApis() {
20
17
  disableProperty(globalObject, 'cookieStore')
21
18
  disableProperty(navigator, 'locks')
22
19
 
23
- Object.defineProperty(HTMLIFrameElement.prototype, 'contentWindow', {
24
- get() {
25
- return null
26
- },
27
- configurable: true,
28
- })
29
-
30
20
  Object.defineProperty(document, 'hasFocus', {
31
21
  value: () => true,
32
22
  configurable: true,
@@ -1,4 +1,5 @@
1
- import { defineGlobal, globalObject } from '@datadog/browser-core'
1
+ import { globalObject } from '@datadog/js-core/util'
2
+ import { defineGlobal } from '@datadog/browser-core'
2
3
  import type { RumPublicApi } from '@datadog/browser-rum-core'
3
4
  import { makeRumPublicApi } from '@datadog/browser-rum-core'
4
5
  import { makeRecorderApi, makeProfilerApi } from '@datadog/browser-rum/internal'