ActiveX Content in a local web page, and “the mark of the web”

为君一笑 提交于 2020-01-21 06:43:04

问题


I'm trying to make a webpage that people will run from their hard drives, locally, and this page will show a .wmv video (which is also stored locally), using Windows Media Player

When I run this, IE shows me the "ActiveX Warning" bar at the top, which is what i'm trying to work around. If I load this from a web server, it loads fine, but from the local disk, it won't.

Now, apparently, MS has added the Mark of the Web thingy precisely to work around this problem, however, I've been trying for a while to make it work, and it just didn't. I still get the warning bar.

Is the Mark of the Web supposed to still work? Or this is some kind of deprecated thing?
Am I doing anything wrong? I'm supposedly following all instructions, it looks like:

and I've tried placing it before DOCTYPE, between DOCTYPE and <HTML>, right after <HTML>, in the <HEAD> of the document, etc. Nothing seems to work.

I've tried this in IE7 and IE8

Any ideas will be GREATLY appreciated.

Thanks!!


回答1:


I've been trying for a while to make it work, and it just didn't. I still get the warning bar.

The usual cause of frustration here is that the Mark Of The Web includes a trailing newline. That newline must be present. And it must be a Windows newline: CR followed by LF. If you edit your file in a sensible text editor that defaults to saving with normal LF newlines, your MOTW will mysteriously not work.

The MOTW is at the very very beginning of the file, and in string literal terms would look like:

"<!-- saved from url=(0014)about:internet -->\x0D\x0A"

Microsoft have not done a good job of documenting this at all.




回答2:


I wasted hours on this problem. Even tried .HTA extension instead of HTML, that worked, but I did not like the .hta application staying open and hanging around like a sore thumb.

Saving the HTML file in UTF-8 instead of ANSI made the Mark of the Web work. This is insane. Thumbs down MS! Why couldn’t this be documented?

The code below is saved as HTML in UTF-8 format and it works for me.

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

    <html>
    <head></head>
    <body>


来源:https://stackoverflow.com/questions/2717596/activex-content-in-a-local-web-page-and-the-mark-of-the-web

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