Resolve iframe CORS errors - Fix #19724 (#19884)

* Resolve iframe CORS errors - Fix #19724

* add newline
This commit is contained in:
James Woglom 2024-02-27 07:17:29 -05:00 committed by GitHub
parent b9935717dc
commit a5ec7fc251
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,8 +1,13 @@
import { MAIN_WINDOW_NAME } from "../../data/main_window";
export const mainWindow =
window.name === MAIN_WINDOW_NAME
? window
: parent.name === MAIN_WINDOW_NAME
? parent
: top!;
export const mainWindow = (() => {
try {
return window.name === MAIN_WINDOW_NAME
? window
: parent.name === MAIN_WINDOW_NAME
? parent
: top!;
} catch {
return window;
}
})();