// simple wrapper around window.open making it easier for testing redirects

export function windowOpen(...args) {
  let popout = window.open.apply(null, args);
  popout.focus();
  return popout;
}

export function navigate(href){
    window.location.assign(href);
}

export function locationRedirect(href) {
  return window.location.replace(href);
}

export function redirectToMobileWeb() {
  let mobileURL = `https://m.twitch.tv${window.location.pathname}${window.location.search}`;
  window.stop();
  return window.location.replace(mobileURL);
}
