Skip to content

Commit 5f9dd91

Browse files
authored
Fixing cross origin issues (#1518)
1 parent ce75e29 commit 5f9dd91

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ui.frontend/src/GuideBridge.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,16 @@ class GuideBridge {
8080
let customEvent = document.createEvent("CustomEvent");
8181
customEvent.initCustomEvent(Constants.GUIDE_BRIDGE_INITIALIZE_START, true, true, {"guideBridge": this});
8282
window.dispatchEvent(customEvent);
83+
// Safely handle cross-origin parent window communication
8384
if (window !== window.parent) {
84-
window.parent.document.getElementById(window.name);
85-
window.parent.dispatchEvent(customEvent);
85+
try {
86+
// Try to access parent window
87+
window.parent.document.getElementById(window.name);
88+
window.parent.dispatchEvent(customEvent);
89+
} catch (e) {
90+
// Silently handle cross-origin security errors
91+
console.debug('Cross-origin access to parent window blocked');
92+
}
8693
}
8794
let self = this;
8895
function onFormContainerInitialised(e) {

0 commit comments

Comments
 (0)