From a parent window say A, trying to open another window - ChildWindow.htm using window.open. I am unable to pass string value from A.
var dialog = window.open("Child_Window.htm?", "title", "width=550px, height= 350px,left=100,top=100,menubar=no,status=no,toolbar=no");
dialog.MyVariable = "some string value";
dialog.opener = window;
In Child window, I get
window.MyVariable
as undefined
The code snippet shown in the question works fine for Chrome browser. And to pass the context to another window in case of Edge browser, follow the below method.
declare a global variable in the parent window
Set the variable
And, access the varable in the child window using window.opener, like -