This one uses postMessage method of Window object to communicate between windows: both parent and child windows has message event listeners attached to window which purpose is to evaluate needed function from listeners object depending on received data. This scheme has two security layers:

  1. Sender window checks origin of a receiver window. Message gets sent only if receiver window is of the specified origin,
  2. Receiver window gives you an opportunity to check sender' origin. It is optional: passed event has an origin attribute, you can ignore it if you want.

Control elements in this block will be available when a child window calculator gets initiated.