Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data urls don't play nice with IE7 and IE6 #218

Closed
brainbugged opened this issue Mar 8, 2011 · 13 comments
Closed

data urls don't play nice with IE7 and IE6 #218

brainbugged opened this issue Mar 8, 2011 · 13 comments

Comments

@brainbugged
Copy link

modernizer-1.7
Line 595 : bool = supportAtRule('@font-face { font-family: "font"; src: url(data:,); }');

Unfortunately, IE6 and IE7 doesn't support url(data:)

IE6 fails to parse this.
IE7 parses it and makes matter even worse when rendering in secure (https) mode. It thinks of data url as insecure content throwing mixed content warning to most users. See medium level default settings in internet explorer.

The best way to solve this is make conditional statement or backport to Modernizer-1.6 style
which was:
bool = supportAtRule('@font-face { font-family: "font"; src: "font.ttf"; }');

Note.
This bug cannot be reproduce in IE8 running in IE7 compatibility mode. Reproducible only in true IE7 browser.

@paulirish
Copy link
Member

can you try this...

bool = supportAtRule('@font-face { font-family: "font"; src: "//:"; }');

Because by declaring 'font.ttf' we actually cause a network request (and 404) for that asset in IE. I think we can avoid it here.. assuming that works.

@brainbugged
Copy link
Author

You are right. So I tried your suggestion to use src instead of data urls and that seems to do the trick. I am using this patch on live site and will let you know if I get any more info on it. So far so good.

@paulirish
Copy link
Member

prevent mixed content warning in ie7, due to @font-face data uri test. thx brainbugged. closed by 7b27f96

@brainbugged
Copy link
Author

Curious. If it's only rule support thats being checked then why not use local('smiley face') variation?

@paulirish
Copy link
Member

android breaks on local. would probably false negative.

@ipixel
Copy link

ipixel commented Mar 30, 2011

I have just experienced this problem testing under IE6 and IE7 with a result of the

"This page contains both secure and nonsecure items"

I originally applied the fix that you had committed
7b27f96

src: url("//:");

But that only worked in IE6, IE7 still hiccuped under one of my pages, so I tried the change provided in this thread instead

src: "//:";

And it did work.

Thanks
Brendan

paulirish added a commit that referenced this issue May 20, 2011
…214. ref #218.

this is a regression, as we had it fixed form #218 but the testBundle stuff reintroduced it. whoops.
@til
Copy link

til commented May 20, 2011

I can confirm the comment from ipixel. When on ssl, with this code:

src: url("//:");

IE7 complains about mixed content, with this code:

src: "//:";

Everything seems to work fine. Unfortunately I could not test it with modernizr-1.8dev (IE7 freezes completely)

@paulirish paulirish reopened this May 23, 2011
paulirish added a commit to SlexAxton/Modernizr that referenced this issue May 26, 2011
@paulirish
Copy link
Member

I cannot repro a mixed content warning with src:url("//:");

i'm using this https://dl.dropbox.com/u/39519/modernizr/test/index.html

can you?

@til
Copy link

til commented Jun 1, 2011

https://dl.dropbox.com/u/39519/modernizr/test/index.html gives me a blank page without js errors and without mixed content warnings on IE7

If it matters the IE7 about box says: 7.0.5730.13 , 128-bit encryption (browser and OS are german)

When I visit the dropbox link with chromium I get 1 failed error "Died on test #2: __globals is not defined "

@brainbugged
Copy link
Author

Will double check and let you know.


From: paulirish reply@reply.github.com
To: amittp@yahoo.com
Sent: Wednesday, June 1, 2011 12:15 AM
Subject: Re: [Modernizr] data urls don't play nice with IE7 and IE6 (#218)

I cannot repro a mixed content warning with src:url("//:");

i'm using this https://dl.dropbox.com/u/39519/modernizr/test/index.html

can you?

Reply to this email directly or view it on GitHub:
#218 (comment)

@dan-kigelman
Copy link

I also see a blank screen with IE7 looking at https://dl.dropbox.com/u/39519/modernizr/test/index.html. I've also reproduced that in my environment. src: url("//:") causes the page to appear blank, but src: "//:" does not. This fix has been very helpful, thank you all!

@remitbri
Copy link

Same problem/solution/happiness as the-confused-one: thanks for the fix!

@paulirish
Copy link
Member

a while ago we switched to using src:url("https://") and we're good now.

thank you everyone!

patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015
…odernizr#214. ref Modernizr#218.

this is a regression, as we had it fixed form Modernizr#218 but the testBundle stuff reintroduced it. whoops.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants