Any way to make "fullscreen" function on website not actually go fullscreen?

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Harkonnen
Moonbather
Moonbather
Posts: 65
Joined: 2014-11-04, 12:27
Location: Kiev, Ukraine

Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Harkonnen » 2023-12-17, 22:51

The problem: when you have a big enough monitor, especially ultrawide one, you often want to have media player on website (youtube, twitch, etc) to not cover your entire screen. But, there is a huge issues with how this websites are designed - in the "normal" mode media player only take small part of browser window, and if you press "fullscreen" button it causes browser to go fullscreen and cover your entire screen.

Any way to make palemoon (setting, addons) to not resize browser window when "fullscreen" is requested by website?
I had and idea to achieve this via window manager (force windows size), but it doesnt work. To be precise, window size stays, but media player on websites is still resized to actual screen resolution.

So what i want is browser to
1. lie to website about screen resolution (report window size)
2. do not change window size when "fullscreen" is requested by website

User avatar
Night Wing
Knows the dark side
Knows the dark side
Posts: 5174
Joined: 2011-10-03, 10:19
Location: Piney Woods of Southeast Texas, USA

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Night Wing » 2023-12-18, 13:49

Define "big enough monitor" with regards to size. What size monitor do you have? Is it 32", 42", 48", 55" etc.
Linux Mint 21.3 (Virginia) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
MX Linux 23.2 (Libretto) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox
Linux Debian 12.5 (Bookworm) Xfce w/ Linux Pale Moon, Linux Waterfox, Linux SeaLion, Linux Firefox

BenFenner
Astronaut
Astronaut
Posts: 588
Joined: 2015-06-01, 12:52
Location: US Southeast

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by BenFenner » 2023-12-18, 13:56

This functionality can be provided by the OS in the form of breaking the display up into virtual monitors. What OS are you running?

User avatar
andyprough
Keeps coming back
Keeps coming back
Posts: 752
Joined: 2020-05-31, 04:33

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by andyprough » 2023-12-18, 14:50

Harkonnen wrote:
2023-12-17, 22:51
you often want to have media player on website (youtube, twitch, etc) to not cover your entire screen
You can just run your videos through the mpv media player. For example, here's a video on using Pale Moon on FreeBSD:

Code: Select all

mpv https://yewtu.be/watch?v=ocCHNdki778
That's it - make the video window as large or small as you like.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by athenian200 » 2023-12-18, 22:52

If it's on YouTube, you can just use Theater mode and that works pretty well.

There is a pref to disable the fullscreen API (full-screen-api.enabled), but I don't know if that will work the way you want. On some websites it falls back to letting the video just fill the browser window, on others it just doesn't let you increase the size of the video at all.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

KlarkKentThe3rd
Astronaut
Astronaut
Posts: 556
Joined: 2018-04-20, 20:31

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by KlarkKentThe3rd » 2023-12-19, 00:49

I don't know how Brave does it, but I want PM to do the same. It breaks streaming YT videos through Discord otherwise.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by athenian200 » 2023-12-19, 02:11

So, I did find a way to do it in the C++ code, but I am not sure how to do it with an extension...

https://xref.palemoon.org/goanna-centra ... .cpp#10887

If I set that value to "return true" instead of "return false," and recompile, any attempt to make a video fullscreen just makes it fill the window without resizing it or making the browser controls disappear. That sounds like what you want if I'm hearing you right, but I am not sure?
2023-12-18 (1).png
I think an extension would probably have to intercept calls to "requestFullscreen" and make it do something different, but that approach would probably work too.

EDIT: Just doing that by itself is a little buggy if you enter and exit the full screen mode a few times, but it seems like all that's happening is it's calling the same code it calls when you hit F11 before applying the "fullscreen" mode to the content. If it can be made to just skip that part of the code, it should make the content fill the viewport without resizing it.
You do not have the required permissions to view the files attached to this post.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Kris_88 » 2023-12-19, 04:21

You can create a bool preference:
full-screen-api.ignore-widgets = true
Then the browser will work exactly as you want, as far as I understand.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by athenian200 » 2023-12-19, 04:43

Kris_88 wrote:
2023-12-19, 04:21
You can create a bool preference:
full-screen-api.ignore-widgets = true
Then the browser will work exactly as you want, as far as I understand.
Confirmed working! Apparently the Mozilla developers left a backdoor in place to do this that isn't exposed by default, because I can imagine it would useful when debugging fullscreen mode, since you want to know if it's a DOM issue or a bad widget interaction.

I somehow missed it, but I wasn't looking in the right place.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
andyprough
Keeps coming back
Keeps coming back
Posts: 752
Joined: 2020-05-31, 04:33

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by andyprough » 2023-12-19, 05:23

Kris_88 wrote:
2023-12-19, 04:21
You can create a bool preference:
full-screen-api.ignore-widgets = true
Then the browser will work exactly as you want, as far as I understand.
That works. Pretty cool! The pref already exists in modern FF (set to 'False' by default), at least it is in the FF fork called Abrowser in the distro I'm using right now.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by athenian200 » 2023-12-19, 06:00

andyprough wrote:
2023-12-19, 05:23
That works. Pretty cool! The pref already exists in modern FF (set to 'False' by default), at least it is in the FF fork called Abrowser in the distro I'm using right now.
Confirmed, this is listed in about:config by default in modern Firefox, and has been since version 59.

https://bugzilla.mozilla.org/show_bug.cgi?id=1422535

It was originally implemented for B2G here:

https://bugzilla.mozilla.org/show_bug.cgi?id=772743

And someone at Mozilla proposed removing the pref here, but is meeting some resistance from people who say it should just be renamed:

https://bugzilla.mozilla.org/show_bug.cgi?id=1808348

So a poorly-named pref is just randomly in the codebase for debugging B2G, but it's actually something users keep requesting without knowing where to find it, and probably some developers don't know it's even in there either.
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Kris_88 » 2023-12-19, 06:18

athenian200 wrote:
2023-12-19, 04:43
but I wasn't looking in the right place.
You were looking in the right place, you just didn't get to the end.
I started searching from the place you indicated.

User avatar
athenian200
Contributing developer
Contributing developer
Posts: 1537
Joined: 2018-10-28, 19:56
Location: Georgia

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by athenian200 » 2023-12-19, 06:42

Ah, good to know. Honestly, I do often get a little ahead of myself when reading code and think I read far enough when I haven't, so that does make sense.

In any case, the pref should be exposed by default in the future. :)
"The Athenians, however, represent the unity of these opposites; in them, mind or spirit has emerged from the Theban subjectivity without losing itself in the Spartan objectivity of ethical life. With the Athenians, the rights of the State and of the individual found as perfect a union as was possible at all at the level of the Greek spirit." -- Hegel's philosophy of Mind

User avatar
moonbat
Knows the dark side
Knows the dark side
Posts: 4984
Joined: 2015-12-09, 15:45

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by moonbat » 2023-12-19, 09:52

athenian200 wrote:
2023-12-19, 06:00
And someone at Mozilla proposed removing the pref here
That's all that they know to do - keep killing Firefox by a thousand cuts since version 4. :x
"One hosts to look them up, one DNS to find them and in the darkness BIND them."

Image
Linux Mint 21 Xfce x64 on HP i5-5200 laptop, 12 GB RAM.
AutoPageColor|PermissionsPlus|PMPlayer|Pure URL|RecordRewind|TextFX

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Moonchild » 2023-12-19, 14:28

"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Kris_88 » 2023-12-19, 15:30

Moonchild wrote:
2023-12-19, 14:28
Issue #2407 (UXP) and Issue #1945
Off-topic:
Would you like to add "dom.always_stop_slow_scripts" as well?
viewtopic.php?f=70&t=30569&p=246517#p246290

Harkonnen
Moonbather
Moonbather
Posts: 65
Joined: 2014-11-04, 12:27
Location: Kiev, Ukraine

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Harkonnen » 2023-12-20, 00:10

Kris_88 wrote:
2023-12-19, 04:21
You can create a bool preference:
full-screen-api.ignore-widgets = true
Then the browser will work exactly as you want, as far as I understand.
Thank you very much, this is exactly it.

Michaell
Lunatic
Lunatic
Posts: 286
Joined: 2018-05-26, 18:13

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Michaell » 2023-12-20, 00:33

The toolbar popup doesn't work with this pref enabled, but F11 still does. Maybe you won't care but I'm used to using the button.
Win10home(1709), PM33.1.0-portable as of Apr 23, '24

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Any way to make "fullscreen" function on website not actually go fullscreen?

Unread post by Kris_88 » 2023-12-20, 00:49

Michaell wrote:
2023-12-20, 00:33
The toolbar popup doesn't work
It works as usual in fullscreen mode.