louisremi / background-size-polyfill

Adds support for background-size "cover" and "contain" to IE8
http://louisremi.github.com/background-size-polyfill/
MIT License
1.26k stars 359 forks source link

Causes mixed content warnings on secure pages. #60

Open georeith opened 9 years ago

georeith commented 9 years ago

See: http://support.microsoft.com/kb/925014

When performing removeChild() on an element with background-image set it will trigger a false mixed content warning. You need to remove the background-image first or use outerHtml = ''.

seanadkinson commented 9 years ago

Fixed this issue for IE7 by replacing this line with the following:

elementStyle.backgroundImage = "none";

The comment above it says:

// set inline background image to the transparent spacer gif
// this allows JavaScript to later set it to "none"

But I didn't see any issues in IE7 with my change. It may not work for IE6 or something, but I didn't need to worry about that since we don't support it.

Hope this helps someone else that spent a full day tracking this down.