Mark of the web

February 21, 2008

...

Earlier, I blogged about running JavaScript tests from Visual Studio 2005 where I automate Internet Explorer to load the HTML tests files directly from disk (file:/// protocol). One hurdle in this approach is the Windows XP SP2 local machine zone lockdown which restricts running scripts in local files. (More info here).

The easiest fix to this problem seemed to be the Mark of the web. Fair enough, I went on to add the mark to my JavaScript html test files, like so:

<!-- saved from url=(0019)http://www.foo.com/ -->

Alas, no luck. I still got the annoying message that I had to tick off the warning message each time Internet Explorer started. The trick here is that the line with the code above must en with CR LF (as mentioned here). Yikes. This problem was caused by Visual Studio not using the “Microsoft/Windows/MS-DOS” standard CR LF, but Unix style line delimiters! I opened up the file in Notepad++, selected Format–>Convert to Windows format, and lo it worked like a charm!


Profile picture

Written by Vidar Kongsli who is a software professional living in Oslo, Norway. Works as a consultant, system architect and developer at Bredvid. You should follow him on Twitter