Place offline web pages in the correct zone with MOTW

For several years I have used a homepage in Internet Explorer (IE) that is a list of links I often visit. I find it a lot more convenient than using Favorites to track this, and it is easier to save, move to a new system when you flatten this one, and even send to someone else if you want. For example, I have nicely formatted lists of links I get asked for a lot in there. When someone sends me an e-mail asking where something is I just open IE, copy the list, paste it into an e-mail, and hit send. It makes for a great way to maintain my links.

That is, it worked great until Windows Vista RC1. The homepage is stored in c:\users\<my user name>\documents\homepage.html. When IE7 opens that page it is in the Computer Zone. Virtually all of the links in it are in the Internet Zone. IE 7 has a new security feature, for good reason, which prevents pages in one zone from opening new pages in a different zone in the same window. In other words, if you are on the Internet and click a link in a page that takes you to a location on your Intranet, the Intranet site opens in a new browser window. This is done to prevent certain cross-site scripting attacks. However, it also makes my custom home page much less useful as I actually want all the links on it to navigate in a new window.

To resolve this I used a feature added to IE years ago called the mark of the web. I first ran across this a few years ago when I used to hang out with a guy that originally implemented it. Basically, it is a way to tag a page with a URL that the page purportedly came from. Instead of rendering the page in zone that it is actually in, it gets rendered in the zone indicated by the mark. The original purpose was to mark all saved pages with the mark of the web so that when the user opens them locally they would not be rendered in the local machine zone. It turns out to be the perfect tool to fix the issue I am running into with Vista though. Open up the HTML page that represents the page you want to mark and put a comment like this one right after the end of the <HTML> tag:

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

The 0041 part is simply a counter that indicates how much of the URL following it to parse (yes, I tried what will happen if you use a very long value: IE will ignore the mark). The other parts are the “saved from url=” and the actual URL. You can put any URL you want, as long as it is in the zone you want.

Published Thu, Sep 14 2006 12:12 PM by jesper
Filed under:

Comments

# Patrick Ogenstad said on 15 September, 2006 02:27 AM
You wouldn't by any chance care to share your favorites in a blog post?
# jesper said on 17 September, 2006 09:09 PM

Patrick, I am working on just that. Right now there is not as much in it as there used to be though.

# cometfish said on 01 February, 2007 04:33 PM

Hi, thanks for the tip, I was so irritated by a new window opening up from my home page everytime! Nifty little trick ;)

Cheers!

# mbchicki said on 23 August, 2008 09:50 PM

my friend received an email last week with her email address along with 20 others.  Then at the end of the list of email addresses her email address appeared again as (email)-motw.com.  My question is, what does the -motw mean as part of an email address?

Thanks.

# jesper said on 23 August, 2008 11:53 PM

It's probably not at all related. That's just something the spammer put in the e-mail address.