سؤال

I have a function with ActiveX Objects in my Javascript file to simulate a F11 for fullscreen mode. I want to sign this code to avoid some security issue, anyone who knows how I could do it ?

The code :

function fullScreenWindow() {

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}");
  }
}
}

Thank you for any help.

هل كانت مفيدة؟

المحلول

Ok, find a workaround. I add the url to the "Trusted Sites" area and it's now correctly working.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top