Skip to content
Open
Changes from all commits
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
6 changes: 3 additions & 3 deletions packages/sdk/src/utils/web-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ export function getWindow(): Window | undefined {
}

/**
* The function try to get window keys, if it is not available it returns empty array.
* The function try to get window entries, if it is not available it returns empty array.
* As an example, for Safari's private mode it returns empty array, because the browser does not allow to get window keys.
*/
export function tryGetWindowKeys(): string[] {
export function tryGetWindowKeys(): [string, any][] {
const window = getWindow();
if (!window) {
return [];
}

try {
return Object.keys(window);
return Object.entries(window);
} catch {
return [];
}
Expand Down