@salesforce-ui-embedding/internal-lightning-ui-embedding 2.2.8-rc.0 → 2.2.9

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.
@@ -7,6 +7,7 @@ import { api, LightningElement } from "lwc";
7
7
 
8
8
  import { buildBootstrapEnvelope, validateHeartbeat, validateShutdown } from "./utils/bootstrap";
9
9
  import { DEFAULT_HEARTBEAT_TIMEOUT_MS, ERROR_CODES, ERROR_PHASES, STATES } from "./utils/constants";
10
+ import { isLightningDomainSameOriginEnabled } from "./utils/gater";
10
11
  import { HostBridge } from "./utils/host-bridge";
11
12
  import { HOST_INFO } from "./utils/host-info";
12
13
  import { createInstrumentation } from "./utils/instrumentation";
@@ -313,10 +314,15 @@ export default class Embedding extends LightningElement {
313
314
  };
314
315
  }
315
316
  const hostOrigin = window.location.origin;
316
- if (this._iframeSrcOrigin === hostOrigin && !isLightningDomain(hostOrigin)) {
317
+ if (
318
+ this._iframeSrcOrigin === hostOrigin &&
319
+ !(isLightningDomainSameOriginEnabled() && isLightningDomain(hostOrigin))
320
+ ) {
317
321
  return {
318
322
  code: ERROR_CODES.SAME_ORIGIN_SRC,
319
- message: "iframe src origin MUST differ from the host document origin.",
323
+ message:
324
+ "iframe src origin MUST differ from the host document origin, unless the host is a Lightning domain " +
325
+ "and the same-origin gate is enabled for it.",
320
326
  };
321
327
  }
322
328
  return null;
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright 2026 Salesforce, Inc. All rights reserved.
3
+ * For full license text, see the LICENSE.txt file in this package.
4
+ */
5
+
6
+ import enableLightningDomainSameOriginGate from "@salesforce/gate/com.salesforce.ui-embedding.enableLightningDomainSameOrigin";
7
+
8
+ /**
9
+ * Rollout gate for the Lightning-domain exemption from the SAME_ORIGIN_SRC check (W-24243195).
10
+ * Default closed → the strict "src origin MUST differ from the host origin" rule applies to every host.
11
+ * Open → a Lightning-domain host may embed a same-origin src. Closing it again is the kill switch.
12
+ */
13
+ export function isLightningDomainSameOriginEnabled() {
14
+ return enableLightningDomainSameOriginGate.isOpen({ fallback: false });
15
+ }
@@ -3,11 +3,11 @@
3
3
  * For full license text, see the LICENSE.txt file in this package.
4
4
  */
5
5
 
6
- // `"2.2.8-rc.0"` is a repo-wide ambient declared in /types/globals.d.ts;
6
+ // `"2.2.9"` is a repo-wide ambient declared in /types/globals.d.ts;
7
7
  // build.mjs substitutes the literal at build time, jest globals supply a test value.
8
8
 
9
9
  /** Identity emitted on `ui/notifications/host-initialized`. */
10
10
  export const HOST_INFO = {
11
11
  name: "lightning-ui-embedding",
12
- version: "2.2.8-rc.0",
12
+ version: "2.2.9",
13
13
  };
@@ -1,4 +1,4 @@
1
- function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == typeof i ? i : i + "";}function _toPrimitive(t, r) {if ("object" != typeof t || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != typeof i) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}function o(e) {
1
+ function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == typeof i ? i : i + "";}function _toPrimitive(t, e) {if ("object" != typeof t || !t) return t;var r;if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {var i = r.call(t, e || "default");if ("object" != typeof i) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === e ? String : Number)(t);}function o(e) {
2
2
  return typeof e == "object" && e !== null && !Array.isArray(e);
3
3
  }
4
4
  function c(e) {
@@ -1,4 +1,4 @@
1
- function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == typeof i ? i : i + "";}function _toPrimitive(t, r) {if ("object" != typeof t || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != typeof i) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);} // Bootstrap envelope vocabulary. Spec: EMBEDDING-PROTOCOL.md §3.1, §3.1.1,
1
+ function _defineProperty(e, r, t) {return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == typeof i ? i : i + "";}function _toPrimitive(t, e) {if ("object" != typeof t || !t) return t;var r;if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {var i = r.call(t, e || "default");if ("object" != typeof i) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === e ? String : Number)(t);} // Bootstrap envelope vocabulary. Spec: EMBEDDING-PROTOCOL.md §3.1, §3.1.1,
2
2
  // MC-7/MC-8/MC-10 in §2.2.
3
3
  /** Wire identifier for this protocol. Carried verbatim on every bootstrap envelope. */
4
4
  const PROTOCOL_NAME = "sf-embedding";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce-ui-embedding/internal-lightning-ui-embedding",
3
- "version": "2.2.8-rc.0",
3
+ "version": "2.2.9",
4
4
  "private": false,
5
5
  "description": "Lightning Base Component (LWC) host for sf-embedding-protocol iframes",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "@salesforce/jsonrpc": "^10.12.3",
25
- "@salesforce/sf-embedding-contract": "2.2.8-rc.0",
26
- "utils": "2.2.8-rc.0"
25
+ "@salesforce/sf-embedding-contract": "2.2.9",
26
+ "utils": "2.2.9"
27
27
  },
28
28
  "sideEffects": false,
29
29
  "publishConfig": {