var google_login_popup = "";
var social_google_login = function () {
google_login_popup = window.open('www.google.com', "google_popup", 'width=800, height=600');
};
social_google_login();
setTimeout(function() {
google_login_popup.close();
}, 1000);
It opens the popup in a new TAB - not window. But .close() doesn't close the window.
This should work as the script opening the window is also trying to close it.
Note that this only applies for Firefox 47, mobile.
Video: https://www.dropbox.com/s/bqcf8iwm5bsw4yn/VIDEO0254.mp4?dl=0.
So far the only way to close fire fox is to click on the shut down button or to end it through the task manger. when I re-open Firefox the windows and previous tabs are also there, and I am still unable to close them.
(IE also allows HTA documents to close themselves without restriction.) In all other circumstances, the tab/window will not silently close: instead, the user is presented with a one of two modal dialogs, depending on whether the page represents the only tab in the browser window:
On Windows: Hold the Shift key when you open the Firefox desktop or Start menu shortcut. On Mac: Hold the option key while starting Firefox. When the Firefox Safe Mode window appears, select "Start in Safe Mode". If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme, or hardware acceleration.
As of Chromium 88, window.close () succeeds if the new window/tab has an opener or if the back/forward stack contains fewer than two entries. As you can see, there are subtle differences here between what the spec requires and what the browser implements. First, notice that I said “has an opener” rather than “was created by a script.”
I tested this in Firefox 47 on mobile (Android 5.1.1, Moto G) and wasn't able to replicate the behaviour using your code in a skeleton web page. However, looking at the video and looking at the code in https://cdn.dorms.com/static/js/social.js there's clearly more going on than just the code you've supplied here on SO.
Suggestions for the person with the device
http://
or https://
and/or make the timeout longer. I doubt very much this will help but there may be some weirdness going on.† My page contains the following HTML:
<!DOCTYPE html>
<html>
<head>
<title>Test web page</title>
<script>
var google_login_popup = "";
var social_google_login = function () {
google_login_popup = window.open('www.google.com', "google_popup", 'width=800, height=600');
};
social_google_login();
setTimeout(function() {
google_login_popup.close();
}, 1000);
</script>
</head>
<body>Test web page</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With