How to tell IE a HTML file on my disk is not a sec

2019-03-10 03:24发布

问题:

Our build script creates a HTML log with some embedded javascript. When I open that in Internet Explorer, I get the yellow warning bar that IE has blocked running "scripts or activex controls".

Since it is a local file, I cannot add it to trusted sites (IE expects a domain here).

I do not want to change security settings for the default zone.

Any idea how to permanently unblock it?

IE version is 7.0.5730.13 on XP Pro.

回答1:

Embed the Mark of the Web:

<!-- saved from url=(0016)http://localhost -->


回答2:

You could add The Mark of the Web to the document so that IE will act as if it's from a certain security zone.



回答3:

Probably not what you want to hear but I'm not sure you can. Does Firefox/Opera/Safari complain when you run it in any of those? If it works then that seems like the simplest solution to me.



回答4:

You can add Local Machine Zone and configure security for it:

http://www.microsoft.com/windows/IE/community/columns/improvements.mspx



回答5:

You can always enable ActiveX. I've tested this on Internet Explorer 11, but should work on earlier version of IE:

Tools > Internet Options > Advanced > Security :

(✓) Allow active content from CDs to run on My Computer
(✓) Allow active content to run in files on My Computer


回答6:

You could set up a local server and save such files in a domain you can now add to the trusted sites, but opening the file in any other browser than IE is easier.



回答7:

Another option, if it's only IE you need to view it in is to save it as a .hta file.

This makes it a HTML application.

It's as simple as changing the suffix to .hta. Although there are other options you can specify.

For more info:

http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx