feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences (#17203)
This option allows users to prevent the window from resizing when the HTML5 FullScreen API is used.
This commit is contained in:
parent
f3fc4023cf
commit
ac88b3ead5
7 changed files with 58 additions and 1 deletions
|
@ -2097,6 +2097,28 @@ describe('BrowserWindow module', () => {
|
|||
expect(typeofProcess).to.eql('undefined')
|
||||
})
|
||||
})
|
||||
|
||||
describe('"disableHtmlFullscreenWindowResize" option', () => {
|
||||
it('prevents window from resizing when set', (done) => {
|
||||
w.destroy()
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
disableHtmlFullscreenWindowResize: true
|
||||
}
|
||||
})
|
||||
w.webContents.once('did-finish-load', () => {
|
||||
const size = w.getSize()
|
||||
w.webContents.once('enter-html-full-screen', () => {
|
||||
const newSize = w.getSize()
|
||||
expect(newSize).to.deep.equal(size)
|
||||
done()
|
||||
})
|
||||
w.webContents.executeJavaScript('document.body.webkitRequestFullscreen()', true)
|
||||
})
|
||||
w.loadURL('about:blank')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('nativeWindowOpen + contextIsolation options', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue