Window.close does not work if the window opens as a tab (Firefox 47)

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); 

Opens a popup in a new TAB - not window. But .close () does not close the window.

This should work, since opening a script window is also trying to close it.

Please note that this applies only to Firefox 47, mobile .

Video: https://www.dropbox.com/s/bqcf8iwm5bsw4yn/VIDEO0254.mp4?dl=0 .

+7
javascript firefox
source share
1 answer

I tested this in Firefox 47 on a mobile device (Android 5.1.1, Moto G) and was unable to reproduce the behavior using your code on the skeleton web page. Nevertheless, looking at the video and looking at the code https://cdn.dorms.com/static/js/social.js , there is clearly more than just the code that you put SO here.

Suggestions for a person with a device

  • Try using some skeletal code or use my page at https://www.dropbox.com/s/db08g2gmn9s8i89/38216372.html?dl=0 † to find out if you can reproduce the problem.
  • Popup URL prefix with http:// or https:// and / or delay the timeout. I doubt very much that this will help, but some oddity can happen.
  • Reset the Firefox application, if this is normal with the device owner. Clear the application data and start over, just to make sure something is hiding.
  • Firefox has USB and Wi-fi capabilities for remote debugging - check under "Settings β†’ Advanced β†’". Scroll down to "learn more." This will really save time trying to debug this.

† 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> 
+1
source share

All Articles