Permalink
Browse files

Don't load deferred CSS if `aoloaddeferedcss=false` is found in URL.

  • Loading branch information...
1 parent 129fd99 commit 49ad0ce896ef702cce3c92d56f5cf315d0d5e3e5 @futtta committed Jan 7, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 classes/autoptimizeStyles.php
@@ -518,7 +518,7 @@ public function getcontent() {
}
} else {
if ($this->defer == true) {
- $deferredCssBlock = "<script data-cfasync='false'>function lCss(url,media) {var d=document;var l=d.createElement('link');l.rel='stylesheet';l.type='text/css';l.href=url;l.media=media;aoin=d.getElementById('aonoscrcss');aoin.parentNode.insertBefore(l,aoin.nextSibling);}function deferredCSS() {";
+ $deferredCssBlock = "<script data-cfasync='false'>function lCss(url,media) {var d=document;var l=d.createElement('link');l.rel='stylesheet';l.type='text/css';l.href=url;l.media=media;aoin=d.getElementById('aonoscrcss');if(window.location.href.indexOf('aoloaddeferedcss=false') === -1){aoin.parentNode.insertBefore(l,aoin.nextSibling);}}function deferredCSS() {";
$noScriptCssBlock = "<noscript id=\"aonoscrcss\">";
$defer_inline_code=$this->defer_inline;
if(!empty($defer_inline_code)){

0 comments on commit 49ad0ce

Please sign in to comment.