Skip to content

window.open(url) does not respect { show: false } #2771

Closed

Description

@matthewmueller

If we initialize a browser window with { show: false }, but the browser window runs JS code that opens a javascript window, then a new browser window will open, regardless of { show: false }

Here's an example:

var app = require('app')
var BrowserWindow = require('browser-window');

app.on('ready', function() {
  win = new BrowserWindow({ show: false });
  win.webContents.loadUrl('http://output.jsbin.com/cekonip/1');
  win.webContents.once('did-finish-load', function() {
    console.log('loaded!');
  })
})

The jsbin runs the following code:

window.open('http://google.com')

Activity

  1. zcbenz commented on Sep 14, 2015

    @zcbenz
    Contributor

    The Web standard says nothing about how should window.open behave when the window is hidden, but I think it is quite reasonable for the child window to inherit parent window's properties.

  2. matthewmueller commented on Sep 14, 2015

    @matthewmueller
    Author

    +1 that sounds like a great default.

  3. bchr02 commented on Sep 14, 2015

    @bchr02

    +1 I agree

  4. mike-thompson-day8 commented on Sep 21, 2015

    @mike-thompson-day8

    +1 - this has become important for us. Although our need is better described by the related #2781.

  5. self-assigned this
    on Sep 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions