Answer the question
In order to leave comments, you need to log in
Emulate pressing F11 in a browser?
Tell me, is it possible to programmatically expand the browser to full screen, as it happens when you press F11?
You need to make a "Fullscreen" link on the site.
Answer the question
In order to leave comments, you need to log in
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
You've already been given a lot of advice that doesn't work for you, so I'll risk giving you one more: Make an application on flash.
In the standard way, i.e. via createEvent & initKeyEvent & dispatchEvent cannot be done. This code has no effect, although the event is sent, caught and the default action is not terminated.
document.addEventListener("keyup", function (e) {console.log(e)}, true);
var evt = document.createEvent("KeyboardEvent");
evt.initKeyEvent(
"keyup", // in DOMString typeArg,
true, // in boolean canBubbleArg,
false, // in boolean cancelableArg,
null, // in nsIDOMAbstractView viewArg
false, // in boolean ctrlKeyArg,
false, // in boolean altKeyArg,
false, // in boolean shiftKeyArg,
false, // in boolean metaKeyArg,
122, // in unsigned long keyCodeArg - 122 F11 key code,
0); // in unsigned long charCodeArg;
var canceled = !document.body.dispatchEvent(evt);
if (canceled) {
// A handler called preventDefault
alert("canceled");
} else {
// None of the handlers called preventDefault
alert("not canceled");
}
1. Make a button with the text "Full screen mode".
2. When you click on it with the mouse, display the prompt "press F11 on the keyboard."
Met only for IE, here's a kind of "decent" example... bitbybit.ru/solution/109/
IE can be launched with the -k option, then it will immediately be in full screen mode.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question