Created
September 28, 2017 11:37
-
-
Save dasginganinja/4594812390e2f281f89e573b1b29ca9e to your computer and use it in GitHub Desktop.
Find mixed mode issues in content. The src attribute matches scripts, images, iframes. The link href attribute is used for css.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function() { | |
var $srcitems = jQuery("[src^='http://']"); | |
var $hrefitems = jQuery("link[href^='http://']"); | |
var totalitems = $srcitems.length + $hrefitems.length; | |
if (totalitems > 0) { | |
alert('Found ' + totalitems + ' items that will trigger mixed mode. Check the console for these items.'); | |
for (var i = 0, len = $srcitems.length; i < len; i++) { | |
console.log($srcitems[i]); | |
} | |
for (var i = 0, len = $hrefitems.length; i < len; i++) { | |
console.log($hrefitems[i]); | |
} | |
} else { | |
alert('No mixed-mode content warnings currently on this page.'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment