<ul dir="auto">
<li>Electron version: 1.4.5</li>
<li>Operating system: win 10</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto"><code class="notranslate">window.open()</code> always opens a visible window.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto"><code class="notranslate">window.open()</code> opens an invisible window if run <code class="notranslate">new BrowserWindow({ show: false });</code> before.</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto"><strong>index.html</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;button type=button onclick=&quot;window.open('index.html')&quot;&gt;Open&lt;/button&gt;"><pre class="notranslate"><code class="notranslate">&lt;button type=button onclick="window.open('index.html')"&gt;Open&lt;/button&gt;
</code></pre></div>
<p dir="auto"><strong>index.js</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require('electron');
app.once('ready', () =&gt; {
	let win = new BrowserWindow({ show: false }); //create a invisible window and show it later
	win.maximize();
	win.show();
	win.loadURL(__dirname + '/index.html');
});"><pre class="notranslate"><code class="notranslate">const {app, BrowserWindow} = require('electron');
app.once('ready', () =&gt; {
	let win = new BrowserWindow({ show: false }); //create a invisible window and show it later
	win.maximize();
	win.show();
	win.loadURL(__dirname + '/index.html');
});
</code></pre></div>
<p dir="auto">Run the app, click the <strong>Open</strong> button, the new window is not visible.</p>
<p dir="auto">Follow-up to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="106256601" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2771" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/2771/hovercard" href="https://github.com/electron/electron/issues/2771">#2771</a>.</p>
<p dir="auto">If:</p>
<ol dir="auto">
<li>you create a <code class="notranslate">BrowserWindow</code> with the <code class="notranslate">show</code> option set to <code class="notranslate">false</code>,</li>
<li>you show that window</li>
<li>JavaScript in that page calls <code class="notranslate">window.open</code></li>
</ol>
<p dir="auto">nothing will happen—no window will appear.</p>
<p dir="auto">My hypothesis is that the new window is inheriting the <code class="notranslate">show</code> option. This is corroborated by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="106256601" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/2771" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/2771/hovercard" href="https://github.com/electron/electron/issues/2771">#2771</a>. (However I tried selecting the "Bring All to Front" menu option (with <code class="notranslate">role</code> set to 'front') and that didn't cause any hidden windows to appear—perhaps that's a separate bug.)</p>
<p dir="auto">I think it's reasonable for a new window to inherit <code class="notranslate">show: false</code> if the parent window is hidden—but after the parent window is shown, child windows should also be shown, no? Otherwise <code class="notranslate">window.open</code> is forever broken in the parent window.</p>
<p dir="auto">(The parent window could call <code class="notranslate">window.open</code> with <code class="notranslate">show=true</code>, but IMO even if Electron chooses to hide child windows, in-page JavaScript loaded from a remote server should not have to be aware of this.)</p>
<p dir="auto">As far as the rest of the options that child windows inherit, I'm undecided whether I think that the child windows should inherit the up-to-date options or the original options. It'd probably simplify the implementation to have everything be up-to-date. On the other hand, perhaps the original options are better defaults for new windows.</p>