Open Bug 830265 Opened 13 years ago Updated 3 years ago

mozRequestFullScreen fails from javascript: link or bookmarklet

Categories

(Core :: DOM: Core & HTML, defect, P5)

x86_64
macOS
defect

Tracking

()

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

Attachments

(1 file)

Attached file testcase
mozRequestFullScreen doesn't work inside a javascript: URL. This is strange, because most things that require clicks do work there. I noticed this while trying to make a "Full screen" bookmarklet (because ^⌘F leaves too many toolbars visible nowadays).
An error in the Error Console shows as follows: Warning: Request for full-screen was denied because Element.mozRequestFullScreen() was not called from inside a short running user-generated event handler. Source file: javascript:document.documentElement.mozRequestFullScreen(); Line: 1
So for window.open() what we do with javascript: URLs is save the popup blocker state at the point when the javascript: load starts and then temporarily push it while running the script. It looks like fullscreen doesn't use the popup blocker state; it uses IsHandlingUserInput() directly. Maybe we need to do something similar for that state for javascript: urls?
I think the main problem is that we have several different state tracking mechanisms. Both the popup blocker state and the IsHandlingUserInput state (though I'm not sure what the latter is to be honest). Could we consolidate this to a single state tracking object and make sure to clone that for javascript URL handling?
I think that's the right approach, yes. Note that the popup blocker state already takes IsHandlingUserInput into account, and additionally looks at what kind of event is going on. My personal opinion is that the popup blocker state is what we should be using everywhere...
It might be good to fix bug 678994 first...
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: