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
|
@ -619,7 +619,17 @@ void CommonWebContentsDelegate::SetHtmlApiFullscreen(bool enter_fullscreen) {
|
|||
return;
|
||||
}
|
||||
|
||||
owner_window_->SetFullScreen(enter_fullscreen);
|
||||
// Set fullscreen on window if allowed.
|
||||
auto* web_preferences = WebContentsPreferences::From(GetWebContents());
|
||||
bool html_fullscreenable =
|
||||
web_preferences ? !web_preferences->IsEnabled(
|
||||
options::kDisableHtmlFullscreenWindowResize)
|
||||
: true;
|
||||
|
||||
if (html_fullscreenable) {
|
||||
owner_window_->SetFullScreen(enter_fullscreen);
|
||||
}
|
||||
|
||||
html_fullscreen_ = enter_fullscreen;
|
||||
native_fullscreen_ = false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue