Firefox prevents running fullscreen code for security reasons (i guess, to prevent social engineering and fraudulent windows).
This is thoroughly discussed in SO, here.
What is not mentioned there, is going fullscreen from bookmarklets.
javascript:(function(){document.documentElement.requestFullscreen();})();
The above works on Chromium; FF blocks it: "Request for fullscreen was denied because Element.requestFullscreen() was not called from inside a short running user-generated event handler."
But the bookmarklet IS triggered by a click. Is it a bug or intentional?
What I tried:
- running the fullscreen command in under 1 second;
- running the command from the console.
- searching SO :)
question from:
https://stackoverflow.com/questions/65930329/fullscreen-from-a-bookmarklet-in-firefox-doesnt-work-how-to-workaround 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…