none
window.open() returns null

    Question

  • Greetings,

    I have encountered a bug in the Edge browser's Javascript implementation of window.open().  When the 'open' function is called, there should be an object returned that is the newly opened window, but returns null.  

    The window opens, but the whole screen, and the window.opener parameter in it is null.

     openNewWin: function (url, onCloseHandler) {
                var wnd = window.open(url, "new", "width=800,height=600,resizable=yes,toolbar=no,location=no,menubar=no,status=no,directories");
            },
    
        loginSocial: function (pLoginType) {
    APP.openNewWin('https://accounts.google.com/o/oauth2/auth?redirect_uri=' + CONFIG.url + '/auth_google.html&response_type=code&client_id=' + CONFIG.googleClientId + '&scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile');
            },


    You can check here:

    https://littlebigsnake.com/ 

    Do you have any information about this bug, and when or if a fix for it might be available?

    Monday, February 05, 2018 5:43 PM

All replies

  • Why do you say it is an error? Please show us the authoritive documentation specifying that the results you are getting is different from what you should get. Please be specific about what you are getting and what you are supposed to get as specified by the documentation. The probable explanation is that there is a misunderstanding of the documentation so it is critical that you be clear and specific about the problem.


    Sam Hobbs
    SimpleSamples.Info

    Monday, February 05, 2018 9:07 PM
  • 
    Problem Description: 
        I'm trying to open a popup window for authorization users via google oauth.
        Google oauth call redirect in opened popup window with auth code, that we need to pass to parent window.
        To do this I need to call window.opener's function from that popup.
        In all browsers it works fine, but Edge. In Edge window opens on full screen and window.opener parameter in it is null.

    Steps to Reproduce:
        Code:
        1. Run Microsoft Edge
        2. Go to https://littlebigsnake.com
        3. Open console
        4. enter window.open("https://accounts.google.com/o/oauth2/auth", "new", "width=800,height=600,resizable=yes,toolbar=no,location=no,menubar=no,status=no,directories");

        UI Example:
        1. Run Microsoft Edge
        2. Go to https://littlebigsnake.com
        3. Push play
        4. Press google oauth button

    Actual Result:
        Edge opens new fullscreen window without any information about opener ( window.opener == null )

    Expected Result:
        Edge opens popup window with 800x600px size and window.opener parameter != null.

    Any Workarounds:
        1. Use other browsers
        2. Open blank page
    window.open("", "new", "width=800,height=600,resizable=yes,toolbar=no,location=no,menubar=no,status=no,directories");
            or relative page
      window.open("https://littlebigsnake.com/auth_vk.html", "new", "width=800,height=600,resizable=yes,toolbar=no,location=no,menubar=no,status=no,directories");

    Tuesday, February 06, 2018 10:53 AM
  • Hi,

    something appears to BLOCKING your popup window when you run it on Edge. I disable flash in Edge and use the Adblock + extension.

    You should test by running Edge in InPrivate mode to see if one of your extensions or the built-in popup blocker is blocking your popup window.

    a common design pattern is to use just window.open([url]) (viz: no size or position constraints)

    Credential validation services like FB connect or Google should be opened in a new window/tab without position or size arguments.

    or

    Replace the scripted window with just an action link.. <a href="url" target="_blank">login with google</a>

    Your site has no feature detection for IE ActiveX filtering or Flash blocking extensions... Flash (if supported) is pre-installed on modern devices.... the adobe getflash url will only confuse visitors.


    Rob^_^

    Thursday, February 08, 2018 9:58 PM