Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Commit

Permalink
Fixes the console.warn error in IE8.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilto committed Nov 27, 2014
1 parent 1164dbf commit cb56c5b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions dist/picturefill.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Picturefill - v2.2.0 - 2014-11-24
/*! Picturefill - v2.2.0 - 2014-11-27
* http://scottjehl.github.io/picturefill
* Copyright (c) 2014 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
Expand Down Expand Up @@ -362,7 +362,8 @@ window.matchMedia || (window.matchMedia = function() {
pf.dodgeSrcset = function( img ) {
if ( img.srcset ) {
img[ pf.ns ].srcset = img.srcset;
img.removeAttribute( "srcset" );
img.srcset = "";
img.setAttribute( "data-pfsrcset", img[ pf.ns ].srcset );
}
};

Expand Down Expand Up @@ -403,7 +404,7 @@ window.matchMedia || (window.matchMedia = function() {

if ( bestCandidate && !pf.endsWith( picImg.src, bestCandidate.url ) ) {
if ( pf.restrictsMixedContent() && bestCandidate.url.substr(0, "http:".length).toLowerCase() === "http:" ) {
if ( typeof console !== undefined ) {
if ( window.console !== undefined ) {
console.warn( "Blocked mixed content image " + bestCandidate.url );
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions dist/picturefill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@

if ( bestCandidate && !pf.endsWith( picImg.src, bestCandidate.url ) ) {
if ( pf.restrictsMixedContent() && bestCandidate.url.substr(0, "http:".length).toLowerCase() === "http:" ) {
if ( typeof console !== undefined ) {
if ( window.console !== undefined ) {
console.warn( "Blocked mixed content image " + bestCandidate.url );
}
} else {
Expand Down

0 comments on commit cb56c5b

Please sign in to comment.