Guilherme, congrats, and thanks for the update. Great job!!
Original Message:
Sent: 06-17-2026 11:41
From: Guilherme Hernandez Hubner
Subject: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login
Hi Breno,
I found the root cause.
After going through all the tests I could think of and using the diagnostic script you shared, I wasn't able to find any evidence of errors or abnormal behavior. At that point, I decided to take a step back and go back to the basics, reviewing every WebRTC setting to see if I had overlooked something.
That's when I noticed an option that was enabled and caught my attention:
Disable WebRTC audio and alerting notifications
I looked into the documentation and found this note:
Note: If you have selected the option to disable WebRTC audio and alerting notifications, then the WebRTC phone window closes automatically.
Reference: https://help.genesys.cloud/articles/browser-window-for-webrtc-phones/
After disabling that option, the WebRTC window remained open after authentication and started working as expected.
A classic case of overlooking a small configuration setting and then spending hours investigating something much more complex 😄
Thanks a lot for your quick help and for sharing the diagnostic script. It was very useful to rule out several possibilities and helped guide the investigation.
Best regards,
------------------------------
Guilherme Hernandez Hubner
Senior Support Analyst
------------------------------
Original Message:
Sent: 06-16-2026 21:52
From: Breno Canyggia Ferreira Marreco
Subject: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login
Guilherme, since the DevTools window closes together with the WebRTC popup, it looks like the popup is not just refreshing or failing internally, the whole popup window context is being closed/destroyed.
Also, since this is happening only for one user, and the user can log in directly to Genesys Cloud outside Salesforce without any issue, I would probably move the focus away from browser, WebRTC, SIP, media, or Genesys authentication.
At this point, I would compare this user with a working one, mainly around the Salesforce/OpenCTI side: Call Center assignment, Softphone layout, Lightning app / utility bar config, Profile and permission sets, Genesys managed package user mapping and Any user-specific Salesforce console/workspace state
One thing that may help is to run the next test from the Salesforce main window, not from the WebRTC popup. This way, even if the popup closes, the Salesforce console should still capture what happened.
Open the browser console in Salesforce, paste this script, and then reproduce the WebRTC popup login flow:
(function () {
console.log("DEBUG START - Salesforce parent window monitor");
const originalOpen = window.open;
const popupRefs = [];
window.open = function () {
console.log("EVENT: window.open invoked");
console.log("ARGS:", arguments);
console.trace("STACK TRACE - window.open");
const popup = originalOpen.apply(window, arguments);
if (popup) {
const record = {
openedAt: new Date().toISOString(),
popup: popup,
closed: false
};
popupRefs.push(record);
const monitor = setInterval(function () {
try {
if (popup.closed) {
record.closed = true;
record.closedAt = new Date().toISOString();
console.log("EVENT: popup closed detected from Salesforce parent window");
console.log("POPUP RECORD:", record);
console.trace("STACK TRACE - popup closed observation");
clearInterval(monitor);
}
} catch (e) {
console.log("EVENT: error while monitoring popup", e);
}
}, 500);
} else {
console.log("EVENT: window.open returned null or undefined");
}
return popup;
};
window.__genesysPopupDebug = {
popupRefs: popupRefs,
originalOpen: originalOpen
};
console.log("Monitor installed. Now reproduce the Genesys WebRTC popup issue.");
})();
If you get `window.open invoked` and then `popup closed detected`, that confirms the popup is really being closed during the Salesforce/OpenCTI flow.
If only this user has the issue, then I'd compare this user side by side with a working one in Salesforce and Genesys.
At this point, based on the symptoms, I don't think this is likely to be a Genesys-side issue. It looks more like something in the Salesforce/OpenCTI context for this specific user.
If you find the root cause, please share the final fix if possible. I'd be interested to know what ended up causing the popup to close for this specific user.
------------------------------
Att,
Breno Canyggia Ferreira Marreco
------------------------------
Original Message:
Sent: 06-16-2026 16:06
From: Guilherme Hernandez Hubner
Subject: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login
Hi Breno.
I was able to run the script successfully in the WebRTC popup and confirmed that the "DEBUG START - Genesys WebRTC Popup" message was displayed.
I also enabled "Preserve log" in DevTools before reproducing the issue.
However, when the issue occurs, the popup window closes and the DevTools session is terminated together with it. Because of that, I was unable to capture the final output from the script or verify whether any of the expected events were triggered before the popup closed.
One additional detail is that the issue affects only a single user. The behavior follows the user across different machines and browsers. The user can also authenticate directly into Genesys Cloud outside of Salesforce without any issues.
Does the fact that the popup and DevTools are both terminated together provide any additional indication about what could be causing the popup to close?
------------------------------
Guilherme Hernandez Hubner
Senior Support Analyst
------------------------------
Original Message:
Sent: 06-16-2026 10:05
From: Breno Canyggia Ferreira Marreco
Subject: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login
Hi Guilherme, Interesting issue. I haven't seen this one very often.
Can you run a quick browser-side diagnostic from the WebRTC popup itself?
open DevTools in the popup window, go to Console, paste the script below, press Enter, and then reproduce the issue while the console is open.
If Chrome blocks the paste, type:
allow pasting
press Enter, and paste the script again.
(function () {
console.log("DEBUG START - Genesys WebRTC Popup");
const results = {
beforeUnload: false,
unload: false,
pageHide: false,
windowClosed: false,
openerLost: false,
navigationDetected: false,
messages: []
};
// Monitor beforeunload
window.addEventListener("beforeunload", function () {
results.beforeUnload = true;
console.log("EVENT: beforeunload triggered");
console.trace("STACK TRACE");
});
// Monitor unload
window.addEventListener("unload", function () {
results.unload = true;
console.log("EVENT: unload triggered");
});
// Monitor pagehide
window.addEventListener("pagehide", function () {
results.pageHide = true;
console.log("EVENT: pagehide triggered");
});
// Intercept window.close
const originalClose = window.close;
window.close = function () {
results.windowClosed = true;
console.log("EVENT: window.close() invoked");
debugger;
return originalClose.apply(this, arguments);
};
// Monitor window.opener
const openerInterval = setInterval(() => {
if (window.opener === null) {
results.openerLost = true;
console.log("EVENT: window.opener lost (parent reference lost)");
clearInterval(openerInterval);
}
}, 500);
// Capture postMessage events
window.addEventListener("message", function (event) {
console.log("EVENT: postMessage received", event.data);
results.messages.push(event.data);
});
// Detect navigation / redirect
let initialHref = window.location.href;
setInterval(() => {
if (window.location.href !== initialHref) {
results.navigationDetected = true;
console.log("EVENT: navigation detected", window.location.href);
}
}, 500);
// Final output
setTimeout(() => {
console.log("FINAL RESULT:");
console.table(results);
console.log("DIAGNOSTIC:");
if (results.windowClosed) {
console.log("CAUSE: window.close() explicitly invoked by script (OpenCTI or adapter)");
} else if (results.openerLost) {
console.log("CAUSE: parent window reference lost (Salesforce Lightning re-render or lifecycle)");
} else if (results.navigationDetected) {
console.log("CAUSE: navigation or redirect detected (possible SSO or reinitialization)");
} else if (results.beforeUnload) {
console.log("CAUSE: external unload event (likely container/lifecycle behavior)");
} else {
console.log("CAUSE: not clear - need to dig deeper into OpenCTI or custom scripts");
}
}, 8000);
})();
How to read the result:
- windowClosed = true
Something is explicitly calling window.close(), possibly the OpenCTI layer, adapter, or custom script.
- openerLost = true
The popup lost its parent window reference. This may happen during Salesforce Lightning re-rendering or softphone reinitialization.
- navigationDetected = true
The popup was redirected or reloaded. This could point to SSO/session refresh or iframe/app reinitialization.
- only beforeUnload = true
The popup is being unloaded by the browser/container lifecycle, not necessarily by an explicit close call.
- no clear signal
Then we should look deeper into OpenCTI events, Salesforce softphone lifecycle, browser console errors, and any custom scripts.
------------------------------
Att,
Breno Canyggia Ferreira Marreco
------------------------------