Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Created February 9, 2015 15:07
Show Gist options
  • Save kkoziarski/8b05d4da3311f9475398 to your computer and use it in GitHub Desktop.
Save kkoziarski/8b05d4da3311f9475398 to your computer and use it in GitHub Desktop.
Replace IFrame http://youtube with https://www.youtube IFrame HTTP -> HTTPS bookmarklet.
//#JS #bookmarkelt
(function($) {
$('iframe[src^="http://youtube"],iframe[src^="http://www.youtube"]').each(function(){
var attr = $(this).attr("src");
attr = attr.replace('http', 'https');
$(this).attr("src", attr);
//var a = document.createElement("a");
//a.href = attr;
//a.innerHTML = attr;
//$(this).parent().get(0).appendChild(a);
});
})(jQuery)
javascript:(function($){$('iframe[src^="http://youtube"],iframe[src^="http://www.youtube"]').each(function(){var attr=$(this).attr("src");attr=attr.replace('http','https');$(this).attr("src",attr);});})(jQuery)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment