Skip to content
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

feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences #17203

Merged

Conversation

@samuelmaddock
Copy link
Member

commented Mar 3, 2019

Description of Change

Adds an option to webPreferences named disableHtmlFullscreenWindowResize. If set to true, the window will retain its size when using the HTML5 Fullscreen API. The requested HTML element will still fullscreen within the viewport though.

This is a fairly specialized use case for my application, Metastream. I'd like to be able to trigger HTML5 fullscreen without causing the window to resize. An example can be seen in the following GIF.

html5-fullscreen

Checklist

Release Notes

Notes: Added disableHtmlFullscreenWindowResize option to webPreferences to allow preventing window from resizing when entering HTML5 fullscreen.

@samuelmaddock samuelmaddock requested review from zcbenz and deepak1556 Mar 3, 2019

@MarshallOfSound
Copy link
Member

left a comment

Calling preventDefault on will-enter-html-full-screen doesn't make a whole log of sense to not cancel the full screen, rather just change it's behavior.

I'd rather add a flag in webPreferences to change the behavior of this for the entire webContents (which would appear to fit your use case.

@electron-cation electron-cation bot removed the new-pr 🌱 label Mar 4, 2019

feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences
This option allows users to prevent the window from resizing when the HTML5 FullScreen API is used.

@samuelmaddock samuelmaddock force-pushed the samuelmaddock:html5-prevent-fullscreen branch from f9fdee1 to 4f0a307 Mar 4, 2019

@samuelmaddock samuelmaddock changed the title feat: add 'will-enter-html-full-screen' event to webContents feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences Mar 4, 2019

@samuelmaddock samuelmaddock requested a review from MarshallOfSound Mar 4, 2019

@samuelmaddock

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2019

Calling preventDefault on will-enter-html-full-screen doesn't make a whole log of sense to not cancel the full screen, rather just change it's behavior.

Agreed.

I'd rather add a flag in webPreferences to change the behavior of this for the entire webContents (which would appear to fit your use case.

@MarshallOfSound I've implemented these changes, how'd I do?

@samuelmaddock samuelmaddock referenced this pull request Mar 7, 2019

Closed

Improve browser security #1

5 of 8 tasks complete
@MarshallOfSound
Copy link
Member

left a comment

This is cleaner than it was before and I much prefer the API.

@MarshallOfSound MarshallOfSound merged commit ac88b3e into electron:master Mar 7, 2019

8 of 9 checks passed

Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-linux Workflow: build-linux
Details
build-mac Workflow: build-mac
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

commented Mar 7, 2019

Release Notes Persisted

Added disableHtmlFullscreenWindowResize option to webPreferences to allow preventing window from resizing when entering HTML5 fullscreen.

@samuelmaddock samuelmaddock deleted the samuelmaddock:html5-prevent-fullscreen branch Mar 7, 2019

Kiku-Reise added a commit to Kiku-Reise/electron that referenced this pull request May 16, 2019

feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences (
electron#17203)

This option allows users to prevent the window from resizing when the HTML5 FullScreen API is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.