Last active
August 29, 2015 14:15
-
-
Save kkoziarski/1eede7b9f6dd0c1bdb4d to your computer and use it in GitHub Desktop.
Redirect to HTTPS bookmarklet
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
//#JS #bookmarkelt | |
//redirect to https | |
(function() { | |
var url = window.location.href.toLowerCase(); | |
if(url.indexOf('https:') < 0 && url.indexOf('http:') >= 0) { | |
var httpsUrl = 'https:' + window.location.href.substring(5); //url.replace('http', 'https'); | |
window.location.href = httpsUrl; | |
} | |
})() |
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
javascript:(function(){var url=window.location.href.toLowerCase();if(url.indexOf('https:')<0&&url.indexOf('http:')>=0){var httpsUrl='https:'+window.location.href.substring(5);window.location.href=httpsUrl;}})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment