export default function(hostTarget) {
  if (!parent.$) {
    return;
  }
  // event handler is on parent's jquery instance.
  let parentWindow = parent.$(parent.window);
  try {
    // window.top can fail on IE due to same origin policy, http://stackoverflow.com/a/326076
    if (window.self !== window.top) {
      parentWindow.trigger("hostModeNotification", { hostTarget });
    }
  } catch (e) {
    parentWindow.trigger("hostModeNotification", { hostTarget });
  }
}
