8000 feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences by samuelmaddock · Pull Request #17203 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add 'disableHtmlFullscreenWindowResize' option to webPreferences #17203

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

Merged

Conversation

samuelmaddock
Copy link
Member
@samuelmaddock samuelmaddock 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.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Mar 3, 2019
Copy link
Member
@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🌱 PR opened recently label Mar 4, 2019
This option allows users to prevent the window from resizing when the HTML5 FullScreen API is used.
@samuelmaddock samuelmaddock force-pushed the html5-prevent-fullscreen branch from f9fdee1 to 4f0a307 Compare March 4, 2019 06:26
@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
Copy link
Member Author

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?

Copy link
Member
@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@MarshallOfSound MarshallOfSound merged commit ac88b3e into electron:master Mar 7, 2019
@release-clerk
Copy link
release-clerk bot 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 html5-prevent-fullscreen branch March 7, 2019 23:34
kiku-jw pushed a commit to kiku-jw/electron that referenced this pull request May 16, 2019
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0