You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window.open() Returns null Reference after a Popup is allowed by user gesture
Currently there is no api to check for popup blocker is active, or quering popup/redirect Permissions are given
In order to check for popup blocker in place
trickery like
window.open().close(); let ref = window.open(location.href, 'newtarget')
is what i and other use, since both calls are made simultaneously within one execution cycle it triggers popup blocker if webpage is denied any popup permissions
What this does is, it prevent second window from opening
But Problem is,
When popup is blocked "Always allow" notification is seen and user allows it,
It opens the second window in above call
but it has null reference "STALE WINDOW"
We can't close it!!!!
Even executing, newRef = window.open('', 'newtarget') Wont return reference as new window's, target Name has been reset ''
User had to manually close this stale window
Or
Ignore the allow popup notification and manually allow popup permission by going to settings or from page info lock icon
This doesnt provide seamless user experience
This is not about bypassing blocker or something
Its about!!!
Any way to "CLOSE STALE WINDOW" programatically, after a popup is allowed,
Is been years in web development, why no one still did something about this??
The text was updated successfully, but these errors were encountered:
Currently for local purpose, testing for popup permission i use this trickery
--> have installed any extension that prevent duplicate tabs
--> popupCheck() {
window.open().close();
win = window.open(location.href);
if (!win|| win.closed) alert('No popup Permission, check for browser notification to allow, or allow manually');
}
In case user allows popup the stale window will have same url as current
so extension will close duplicate previous tab
What is the issue with the HTML Standard?
window.open() Returns null Reference after a Popup is allowed by user gesture
Currently there is no api to check for popup blocker is active, or quering popup/redirect Permissions are given
In order to check for popup blocker in place
trickery like
window.open().close(); let ref = window.open(location.href, 'newtarget')
is what i and other use, since both calls are made simultaneously within one execution cycle it triggers popup blocker if webpage is denied any popup permissions
What this does is, it prevent second window from opening
But Problem is,
When popup is blocked "Always allow" notification is seen and user allows it,
It opens the second window in above call
but it has null reference "STALE WINDOW"
We can't close it!!!!
Even executing, newRef = window.open('', 'newtarget') Wont return reference as new window's, target Name has been reset ''
User had to manually close this stale window
Or
Ignore the allow popup notification and manually allow popup permission by going to settings or from page info lock icon
This doesnt provide seamless user experience
This is not about bypassing blocker or something
Its about!!!
Any way to "CLOSE STALE WINDOW" programatically, after a popup is allowed,
Is been years in web development, why no one still did something about this??
The text was updated successfully, but these errors were encountered: