Will The Mark of the Web always ensure IE runs local HTML file

雨燕双飞 提交于 2019-12-12 05:19:31

问题


We are distributing a CD that displays our HTML based menu on AutoRun. The menu(a local HTML file) runs in the users browser and communicates information about whats on the CD (a Customisation Package so NOT an installer). Our menu relies heavily on JQuery so not being able to run Javascript is not good. We chose to make the menu in HTML, CSS, Javascript to achieve cross-platform compatibility.

Because we are running a local HTML file that uses Javascript we encounter IE's restriction from running scripts or ActiveX Controls.

Our solution (according to our previous question) is to use The Mark of the Web. But we have one question:

Is this the silver bullet that will overcome IE's restrition?

Will The Mark of the Web work on IE V8 and up? Can I say with certainty that this will overcome IE's restriction or are there other factors I need to consider?


回答1:


This does indeed appear to be "The Silver Bullet". One of the reasons to include MOTW, in fact, the first reason is:

  • You are coding pages that will be viewed from a CD, DVD, or other local storage device. (Be aware that users can, but won't necessarily, exempt local content from this security feature.)

The following code causes the file to be run in the Internet zone, which will remove the restrictions placed by IE. Please note that some users settings can prevent this code working, or a user can manually bypass this feature and force the window to run in the normal way which will prevent your JS from working.

<!-- saved from url=(0014)about:internet -->

There is no specifics on where it should be placed appart from The comment must appear in the first 2,048 bytes of the HTML document, within the HTML markup.

As for your question regarding it's compatibility, the feature was introduced in Microsoft Internet Explorer 4.0 and is compatible with every version from there up.



来源:https://stackoverflow.com/questions/16005663/will-the-mark-of-the-web-always-ensure-ie-runs-local-html-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!