diff --git a/comcastify.js b/comcastify.js index 54f9474..6b892fe 100644 --- a/comcastify.js +++ b/comcastify.js @@ -47,7 +47,8 @@ var comcastifyjs = (function () { boxColor: args.boxColor || '#000000', // color of box overlay loadMaxPercent: args.loadMaxPercent || 0.0, // max percentage to load images loadSpeed: args.loadSpeed || 500, // how often in ms to pass - loadIncrement: args.loadIncrement || 1 // pixels to load per pass + loadIncrement: args.loadIncrement || 1, // pixels to load per pass + fastLaneWhitelist: args.fastLaneWhitelist || [], // domains to whitelist }; // make 'em load slow @@ -57,6 +58,11 @@ var comcastifyjs = (function () { parent = img.parentNode, slowload = document.createElement('DIV'); + // whitelisted? + if (params.fastLaneWhitelist.indexOf((new URL(img.src)).hostname) !== -1) { + continue; + } + // set up initial state of box slowload.style.backgroundColor = params.boxColor; slowload.style.width = img.offsetWidth + 'px'; @@ -92,4 +98,4 @@ var comcastifyjs = (function () { fixMyImagesLoadingSoFast: slowImages }; -})(); \ No newline at end of file +})(); diff --git a/example/example.html b/example/example.html index c9a4262..8cf166b 100644 --- a/example/example.html +++ b/example/example.html @@ -23,6 +23,10 @@ http://www.wisegeek.com/what-are-the-main-components-of-a-sloth-diet.htm#sloth-in-tree-showing-claws +
+ +
+ - \ No newline at end of file +