Search code examples
internet-explorersvginternet-explorer-9activex

SVG in IE9 triggering ActiveX popup on click


My SVG logo in Internet Explorer 9 causes the "Internet Explorer restricted this webpage from running scripts or ActiveX controls" on click.

I've tried two different ways to load the image in html.

<object data="../logo.svg" type="image/svg+xml"></object>

and

<embed src="../logo.svg" type="image/svg+xml" pluginspage="http://www.adobe.com/svg/viewer/install/" />

Both have the popup come up. Some other things to note. I am using this tag to force IE9 into standards mode.

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />

The svg image renders fine. It also works completely fine as a PNG, however, I'd like to know if there is a way to get this to work without just using a PNG. Thanks.


Solution

  • See this blog to understand the Local Machine Lockdown that leads to this prompt.

    To workaround this, explicitly place your content into the Internet (or Intranet) security zone as described in that article. To wit:

    Save your file as UTF-8 or Big Endian Unicode (Little Endian is not supported). Within the first 2kb of the file, just inside the document type declaration, add the following HTML comment:

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