ent window with a different CSP
// policy, make it navigate to about:blank.
//
// Web browser behavior might change depending on whether a pending navigation
// exists for in the popup or not. Both are tested here.

const same_origin = get_host_info().HTTP_ORIGIN;

// Return a promise, resolving when |element| triggers |event_name| event.
const future = (element, event_name) => {
  return new Promise(resolve => element.addEventListener(event_name, resolve));
};

// `createNewPopup` is a function returning a