blob: 7100c3f48a5b643c66434efdb180ea0ccb3a7dc3 [file] [log] [blame]
function open_and_add_load_event(href, func) {
// While not practically possible, opening "blank" first and setting the
// href after allows for the theoretical possibility of registering the event
// after the window is loaded.
let popup_window = window.open("about:blank");
assert_not_equals(popup_window, null, "Popup windows not allowed?");
popup_window.addEventListener('load', func, false);
popup_window.location.href=href;
}