0

I want a button act like F11 (keyboard) in Google Chrome and like F10 in Firefox if the device is desktop only. I mean I want place a shortcut for my user so my user shouldn't press F11 he can click on the button instead F11 on the keyboard.

lurker
  • 56,987
  • 9
  • 69
  • 103
  • Looks like a duplicate of https://stackoverflow.com/questions/7179535/set-window-to-fullscreen-real-fullscreen-f11-functionality-by-javascript – Wiktor Zychla Jun 19 '19 at 10:50
  • 1
    Possible duplicate of [Set window to fullscreen (REAL fullscreen; F11 functionality) by javascript](https://stackoverflow.com/questions/7179535/set-window-to-fullscreen-real-fullscreen-f11-functionality-by-javascript) – Turnip Jun 19 '19 at 10:55

1 Answers1

0

You can use the fullscreen api to get this result.

https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API

This allow you to request fullscreen for a given element.

Here is an example from w3schools:

https://www.w3schools.com/jsref/met_element_requestfullscreen.asp

Zackorrigan
  • 178
  • 1
  • 10