Genesys Cloud - Main

 View Only

Sign Up

Expand all | Collapse all

Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login

  • 1.  Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login

    Posted 7 hours ago

    Hello everyone,

    I'm looking for guidance regarding a very unusual issue involving Salesforce and the Genesys Cloud Embeddable Framework.

    Environment

    • Salesforce
    • Genesys Cloud Embeddable Framework
    • SSO authentication
    • Managed Package version 4.2
    • WebRTC configured with "Pop WebRTC Phone Window" enabled

    Issue Description

    The user accesses Salesforce normally and the Genesys Cloud Embeddable Framework loads successfully within Salesforce.

    During the authentication process, a separate popup window is opened by Genesys Cloud. The user authenticates successfully and remains logged in.

    The expected behavior is that this popup window remains open and becomes the WebRTC Phone Window.

    However, immediately after authentication is completed, the popup window closes automatically.

    The user remains authenticated in both Salesforce and Genesys Cloud, but since the WebRTC Phone Window is no longer available, the agent cannot receive voice interactions.

    Expected Flow

    Salesforce

    → Genesys Cloud Embeddable Framework loads

    → Authentication popup opens

    → User authenticates successfully

    → Popup remains open as the WebRTC Phone Window

    Actual Flow

    Salesforce

    → Genesys Cloud Embeddable Framework loads

    → Authentication popup opens

    → User authenticates successfully

    → Popup closes automatically

    → User remains logged in but without an active WebRTC Phone Window

    Troubleshooting Performed

    I have already performed the following tests:

    • Cleared browser cache and cookies
    • Disabled browser extensions
    • Tested with different browsers
    • Confirmed that "Pop WebRTC Phone Window" is enabled
    • Tested on a different workstation
    • Confirmed the behavior is reproducible

    Additional Troubleshooting Performed

    To rule out user-specific and configuration-related issues, I also:

    • Recreated the Genesys Cloud user account
    • Recreated the assigned WebRTC phone
    • Verified that all browser permissions required by Genesys Cloud are allowed
    • Verified that pop-ups are permitted
    • Verified microphone permissions
    • Verified cookies and site permissions
    • Tested after re-authentication and configuration recreation

    Despite these actions, the behavior remains unchanged.

    Findings

    I reviewed the HAR file, browser console logs, and a screen recording of the issue.

    No WebRTC, SIP, media, connectivity, or authentication errors were identified.

    The only notable entries found in the logs were page unload events:

    12:39:49.812 PM => Encountered page unload (page was refreshed, navigated away or closed)
    12:40:18.148 PM => Encountered page unload (page was refreshed, navigated away or closed)
    12:41:11.165 PM => Encountered page unload (page was refreshed, navigated away or closed)

    No additional errors were observed immediately before the popup window closed.

    Additional Information

    This behavior appears to affect only one specific user.

    Initially I suspected a workstation issue, but the behavior persisted after testing on a different machine.

    The user remains authenticated in both Salesforce and Genesys Cloud after the popup closes, which makes the behavior even more unusual.

    At this point, I'm trying to understand what could cause the authentication popup to close immediately after successful authentication instead of remaining open as the WebRTC Phone Window.

    An important detail is that this setup worked normally for this agent until June 9th, 2026.

    After the issue was reported, I reviewed the Audit Logs and could not identify any changes to the user's configuration, permissions, roles, WebRTC phone assignment, or other relevant settings around the time the issue started occurring.

    From the information available, the behavior appears to have started without any known user-related configuration changes.

    Has anyone experienced a similar issue when using the Genesys Cloud Embeddable Framework with Salesforce?

    Any insight, recommendation, or similar experience would be greatly appreciated.

    Thank you.


    #API/Integrations
    #Omni-ChannelDesktop/UserInterface

    ------------------------------
    Guilherme Hernandez Hubner
    Senior Support Analyst
    ------------------------------


  • 2.  RE: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login
    Best Answer

    Posted 6 hours ago
    Edited by Jason Kleitz 2 hours ago

    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
    ------------------------------



  • 3.  RE: Salesforce + Genesys Cloud Embeddable Framework - WebRTC Phone Window Closes After Successful Login

    Posted 34 minutes ago

    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
    ------------------------------