miniSearch / client /modules /parentWindow.ts
github-actions[bot]
Sync to HuggingFace Spaces
f152ae2
raw
history blame contribute delete
243 Bytes
export function postMessageToParentWindow(message: unknown) {
const parentWindow = self.parent;
const targetOrigin = parentWindow?.[0]?.location?.ancestorOrigins?.[0];
if (targetOrigin) parentWindow.postMessage(message, targetOrigin);
}