function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AichaSFAichaSF 

LWC and External Site window

Hello,
I have a request from my client:
From an external site (window), an agent clicks on a button, the salesforce page opens, the agent clicks on another button in the account detail page, and he returns to the 1st page (the SF page closes).

We used an LWC and JS code:
 'window.addEventListener' from external site to SF.
window.opener.postMessage
({ func: 'echo',
message: "message" }, '*');
 * window.close ();


in order to resume the original page.

When I log (window.opener) I got undefined.
Can someone help me.