Created
August 30, 2016 01:02
-
-
Save dbalatero/38e3949b1894173791bc32946c75bea8 to your computer and use it in GitHub Desktop.
A fix for Neil's site to make sure any bad embeds get fixed
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
<script src="https://code.jquery.com/jquery-3.1.0.slim.min.js" integrity="sha256-cRpWjoSOw5KcyIOaZNo4i6fZ9tKPhYYb6i5T9RSVJG8=" crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
// Fix for archive.org embed links that have erroneous http:// urls instead | |
// of https:// | |
$(function() { | |
$("iframe").each(function(index, iframe) { | |
var $iframe = $(iframe); | |
var src = $iframe.attr('src'); | |
if (src.indexOf("http://") >= 0) { | |
$iframe.attr('src', src.replace(/^http:/, "https:")); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment