MiniSearch / client /modules /parentWindow.ts
github-actions[bot]
Sync from https://github.com/felladrin/MiniSearch
8163715
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);
}