本文介绍了如何在JavaScript中对activeX对象进行签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Javascript文件中有一个带有ActiveX对象的函数,可以为全屏模式模拟F11。
我想在此代码上签名以避免任何安全问题,任何知道我该怎么做的人?
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 ?
代码:
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}");
}
}
}
感谢您的帮助。
推荐答案
好的,找到一种解决方法。我将网址添加到受信任的站点区域,现在可以正常使用了。
Ok, find a workaround. I add the url to the "Trusted Sites" area and it's now correctly working.
这篇关于如何在JavaScript中对activeX对象进行签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!