Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Embed: derive `host_application` metadata from `document.referrer` so the parent page's origin is reported instead of the iframe host (`cdn.smileidentity.com`)

## [11.4.4] - 2026-05-27

### Changed
Expand Down
18 changes: 16 additions & 2 deletions packages/embed/src/js/metadata/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,24 @@ const getArchitectureFromWebGPU = async () => {
}
};

const getHostApplication = () => {
// Reason: embed runs inside an iframe on cdn.smileidentity.com, so
// window.location is always our own origin. document.referrer is the
// parent page set by the browser (origin-only under default
// strict-origin-when-cross-origin policy), which is what we want.
if (document.referrer) {
try {
return new URL(document.referrer).origin;
} catch {
// fall through to self-origin fallback
}
}
return `${window.location.protocol}//${window.location.hostname}`;
};

export const initializeMetadata = async () => {
metadata = [];
const hostApplication = `${window.location.protocol}//${window.location.hostname}`;
addMetadataEntry('host_application', hostApplication);
addMetadataEntry('host_application', getHostApplication());

Comment on lines 227 to 230
if (
'ondeviceproximity' in window ||
Expand Down
Loading