Skip to content

Instantly share code, notes, and snippets.

@hugollm
Last active December 27, 2017 14:05
Show Gist options
  • Save hugollm/007e95d44892a2aeb65b83605b9d5ebb to your computer and use it in GitHub Desktop.
Save hugollm/007e95d44892a2aeb65b83605b9d5ebb to your computer and use it in GitHub Desktop.
Pseudo code showing how to open a popup "assinchronously" without being blocked by the browsers
// The idea is to load a placeholder popup right after the click
// and then redirect it later to the real location.
// on click
let popup = showPlaceholderPopup('Loading...');
api.get('/obtain-the-real-url').then(url => {
popup.location.href = url;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment