New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parent's visibility trumps inherited 'show' option #12228
Changes from 4 commits
685948b
e4d5ae5
379bd79
2d90e76
e400585
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,26 @@ describe('chromium feature', () => { | |
b = window.open(`file://${fixtures}/pages/window-open-size.html`, '', 'show=no') | ||
}) | ||
|
||
for (const show in [true, false]) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for (const show of [true, false])
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lol, I love how this works regardless though, because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shia_lebeouf_magic.gif |
||
it(`inherits parent visibility over parent {show=${show}} option`, (done) => { | ||
let w = new BrowserWindow({show: show}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. const w = new BrowserWindow({show}) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technically the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can. You just declare a new variable that simply shadows the one declared above it. |
||
|
||
// toggle visibility | ||
if (show) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (nit) for something this short, maybe use a ternary? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried it that way and wound up in an ad-hoc bikeshed session with Sam and Alexey with more opinions than people. Let's leave it as-is. 😆 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sounds good to me 😁 already approved, ready when CI goes ✅! |
||
w.hide() | ||
} else { | ||
w.show() | ||
} | ||
|
||
w.webContents.once('new-window', (e, url, frameName, disposition, options) => { | ||
assert.equal(options.show, w.isVisible()) | ||
w.close() | ||
done() | ||
}) | ||
w.loadURL(`file://${fixtures}/pages/window-open.html`) | ||
}) | ||
} | ||
|
||
it('disables node integration when it is disabled on the parent window', (done) => { | ||
let b | ||
listener = (event) => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say that
isVisible()
always returns a booleanhttps://github.com/electron/electron/blob/master/docs/api/browser-window.md#winisvisible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah didn't really query this, but looking at it, it can only ever be true/false right?