locked
Activate F11 On Page Load Automtically RRS feed

  • Question

  • User-807418713 posted

    Hello

    I have one page if user load that page example: Display.aspx it should open with F11 full view

    how to do using page load in asp.net C#

    Thanking You

    Friday, September 14, 2018 12:40 PM

Answers

  • User1724605321 posted

    Hi Gopi.MCA,

    You can use below JS function to enable full screen(test on IE11 and chrome 69.0.3497.92 ) :

    var el = document.documentElement
        , rfs = // for newer Webkit and Firefox
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
            || el.msRequestFullscreen
    ;
    if(typeof rfs!="undefined" && rfs){
      rfs.call(el);
    } else if(typeof window.ActiveXObject!="undefined"){
      // for Internet Explorer
      var wscript = new ActiveXObject("WScript.Shell");
      if (wscript!=null) {
         wscript.SendKeys("{F11}");
      }
    }

    The API only works during user interaction , for example , triggered by a user (eg. a button) , so it cannot be triggered automatically on pageload .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 17, 2018 5:33 AM

All replies

  • User753101303 posted

    Hi,

    If this is for a "kiosk" application, it can be done by passing an argument on the command line to the browser. If this is not a dedicated machine use https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API but as often the user can accept or deny your full screen request (for safety reason and to keep them in control).

    Friday, September 14, 2018 4:12 PM
  • User1724605321 posted

    Hi Gopi.MCA,

    You can use below JS function to enable full screen(test on IE11 and chrome 69.0.3497.92 ) :

    var el = document.documentElement
        , rfs = // for newer Webkit and Firefox
               el.requestFullScreen
            || el.webkitRequestFullScreen
            || el.mozRequestFullScreen
            || el.msRequestFullscreen
    ;
    if(typeof rfs!="undefined" && rfs){
      rfs.call(el);
    } else if(typeof window.ActiveXObject!="undefined"){
      // for Internet Explorer
      var wscript = new ActiveXObject("WScript.Shell");
      if (wscript!=null) {
         wscript.SendKeys("{F11}");
      }
    }

    The API only works during user interaction , for example , triggered by a user (eg. a button) , so it cannot be triggered automatically on pageload .

    Best Regards,

    Nan Yu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 17, 2018 5:33 AM