brave-browser: Add a setting to hide the `To exit full screen, press ESC` message when going fullscreen on videos

Test plan

  1. Fresh profile
  2. In tab 1, visit YouTube.com and view a view
  3. Click the full screen square icon in the bottom right of the video
  4. You should see the “To exit full screen, press <kbd>esc</kbd>” message
  5. Hit escape to go back to regular mode
  6. In tab 2, visit brave://settings/system
  7. Toggle the new Show full screen reminder to press Esc on exit setting to FALSE
  8. Go back to tab 1
  9. Click the full screen square icon in the bottom right of the video
  10. You should NOT see the reminder from step 4

Platforms

Linux, macOS, Windows

Description

Folks should be able to turn off this message which shows each time they go fullscreen on a video in the browser image

For example, Vivaldi has this configurable - under Webpages group in settings, with Show Fullscreen Reminder (defaulted to true). image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Verified PASSED using

Brave | 1.69.88 Chromium: 127.0.6533.26 (Official Build) nightly (x86_64)
-- | --
Revision | d60303973dc3604d9d348b981322a8a04dcbb86d
OS | macOS Version 11.7.10 (Build 20G1427)

Case One: Show full screen reminder to press Esc on exit defaulted to On/Enabled

Steps:

  1. installed 1.69.88
  2. launched Brave
  3. opened brave://settings/system
  4. confirmed Show full screen reminder to press Esc on exit was set to Enabled/On by default
  5. loaded https://www.youtube.com/watch?v=sdVWKpqZaXg
  6. clicked on View in Fullscreen

Confirmed I saw To exit full screen, press [Esc]

example example example
Screen Shot 2024-07-08 at 2 38 24 PM Screen Shot 2024-07-08 at 2 38 59 PM Screen Shot 2024-07-08 at 2 39 03 PM

Case Two: Show full screen reminder to press Esc on exit toggled to Off/Disabled

Steps:

  1. installed 1.69.88
  2. launched Brave
  3. opened brave://settings/system
  4. toggled Show full screen reminder to press Esc on exit to Disabled/Off
  5. loaded https://www.youtube.com/watch?v=sdVWKpqZaXg
  6. clicked on View in Fullscreen

Confirmed I didn’t see the To exit full screen, press [Esc]

example example example
Screen Shot 2024-07-08 at 2 42 21 PM Screen Shot 2024-07-08 at 2 45 34 PM Screen Shot 2024-07-08 at 2 45 40 PM

I guess this patch will probably hide both the tab-initiated and browser-initiated bubbles. I will check and confirm.

@bsclifton FYI: As expected, based on params, an appropriate bubble will be created. Since our primary goal is to only handle the bubble when going fullscreen on videos, I’ll do something like this:

if (params.type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION) {
  return;
}

Here’s the patch I tried (obviously we’d want to use the chromium_src override)

diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 4b52ce3877855040f91fc48afdcbbd347e30a8c0..cd4a37e5adc3cc78c6e06fd130ab04ef120a10ab 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1961,6 +1961,10 @@ void BrowserView::ExitFullscreen() {
 void BrowserView::UpdateExclusiveAccessBubble(
     const ExclusiveAccessBubbleParams& params,
     ExclusiveAccessBubbleHideCallback first_hide_callback) {
+
+  //BSC - test. Don't show the exit
+  return;
+
   // Trusted pinned mode does not allow to escape. So do not show the bubble.
   bool is_trusted_pinned =
       platform_util::IsBrowserLockedFullscreen(browser_.get());

I guess this patch will probably hide both the tab-initiated and browser-initiated bubbles. I will check and confirm.

Hi @jagadeshjai that would be great! I think this can easily be done using a chromium_src override for chrome/browser/ui/views/frame/browser_view.cc

Basically, we can replace the BrowserView::UpdateExclusiveAccessBubble method with a new method that checks the pref and exits if true. If pref is false, we can call the original Chromium method. I just verified this works great 😄

Here’s the patch I tried (obviously we’d want to use the chromium_src override)

diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 4b52ce3877855040f91fc48afdcbbd347e30a8c0..cd4a37e5adc3cc78c6e06fd130ab04ef120a10ab 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1961,6 +1961,10 @@ void BrowserView::ExitFullscreen() {
 void BrowserView::UpdateExclusiveAccessBubble(
     const ExclusiveAccessBubbleParams& params,
     ExclusiveAccessBubbleHideCallback first_hide_callback) {
+
+  //BSC - test. Don't show the exit
+  return;
+
   // Trusted pinned mode does not allow to escape. So do not show the bubble.
   bool is_trusted_pinned =
       platform_util::IsBrowserLockedFullscreen(browser_.get());

@rebron thanks for helping find a place to land it!

Hi @bsclifton , I would like to take this task.

Clarification - Do you want me to use this Option Show Fullscreen Reminder for only tab-initiated fullscreen or including others as well(Like Browser initiated - F11).