Skip to content

Instantly share code, notes, and snippets.

@esynaps
Created May 29, 2019 14:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save esynaps/a209c5d244b117c3e79d80c208a1fd46 to your computer and use it in GitHub Desktop.
Save esynaps/a209c5d244b117c3e79d80c208a1fd46 to your computer and use it in GitHub Desktop.
let win = window.open(path, '_blank')
let loading = setTimeout(function () {
//Browser has blocked it
alert('Please allow popups for this website')
}, 5000)
try {
win.addEventListener('load', function () {
clearTimeout(loading)
})
}
catch (e) {
clearTimeout(loading)
alert('Please allow popups for this website')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment