The method of calling functions and variables is the same. You need to first obtain the window object where the function you want to call is located, and then call it through window.method() or window.variable.
The following example demonstrates how a pop-up window can call methods and variables in the parent window.
Parent window: 1.html