9

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!!

Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243

2 Answers2

18

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.

bobince
  • 528,062
  • 107
  • 651
  • 834
  • bobince: Thank you for your reply. I saw this somewhere and made sure this is happening. I'm using Notepad++, set to Windows format and to show me ALL characters. I put the MOTW right at the start of the file, and it has CR and LF at the end of the line. It's still not working... Any other ideas? – Daniel Magliola Apr 26 '10 at 23:43
  • 1
    @DanielMagliola: Check you're not saving it as UTF-16LE (which Windows misleadingly calls “Unicode”). Apart from being generally a bad choice of encoding for web pages, UTF-16-without-BOM also makes the MOTW fail for some unknown reason. If it's not that, I don't know... could you maybe upload a non-working file somewhere to look at? – bobince Apr 27 '10 at 08:18
  • 1
    Just checked? The file was encoded as ANSI. Changed it to UTF-8 with BOM, and still doesn't work. You can see the file here: http://farhatguitar.com/motw.htm (of course it works in that URL, but downloading it, I get the activex warning) Thank you! – Daniel Magliola Apr 27 '10 at 15:03
  • The newline in that file is LF, not CRLF. (UTF-8 is fine, both with an without BOM, though BOM is meaningless for a UTF-8 and should generally be omitted.) – bobince Apr 27 '10 at 15:27
  • bobince, ouch, just checked. I think the fact it's in a linux server is screwing with that newline, sorry. Or maybe filezilla is changing the newlines when uploading? In my local hard drive, I promise it's CRLF. I can upload it zipped if you want.. – Daniel Magliola Apr 29 '10 at 00:21
  • You could try, though if I load your file into an editor and save it out again with CRLF line endings and no other changes, IE loads it without security complaints. (I guess the line ending change on your server is because you uploaded it using FTP in ASCII mode? In this mode it automatically changes all line endings from the client's convention to the server's, which of course is terrible because you almost never want that. You should be able to tell your client to always use BINARY mode... or, better, stop using ancient, insecure, awful FTP and go to SFTP instead.) – bobince Apr 29 '10 at 00:27
  • 1
    @bobince: awesome post. This problem had me stumped and frustrated. Thanks so much! – Mike Clark Nov 04 '10 at 19:16
  • 1
    @bobince Still helps 7 years later! notepad++->EOL conversion->Windows and fixed! Can't believe it lol – Aaron Sep 01 '17 at 20:06
4

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>
qwerty jones
  • 131
  • 1
  • 2
  • "This is insane. Thumbs down MS! Why couldn’t this be documented?" Very strongly seconded, this is insane. Your suggestion to save as UTF-8 worked. – Jordan Gray Sep 30 '13 at 16:19