imgur HTTP-to-HTTPS redirector

Replace http:// with https:// in the address bar

  1. // ==UserScript==
  2. // @name imgur HTTP-to-HTTPS redirector
  3. // @namespace https://greasyfork.org/users/19952-xant1k-bt
  4. // @description Replace http:// with https:// in the address bar
  5. // @include http://imgur.com/*
  6. // @include http://i.imgur.com/*
  7. // @version 1.0
  8. // @author Xant1k@bt
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function(){
  13. var debug = 0;
  14. var new_location = location.href.replace(/http\:/, 'https:');
  15. if ( debug > 0 ) {
  16. alert( "Hash: "+location.hash+
  17. "\nHost: "+location.host+
  18. "\nHostname: "+location.hostname+
  19. "\nHREF: "+location.href+
  20. "\nPathname: "+location.pathname+
  21. "\nPort: "+location.port+
  22. "\nProtocol: "+location.protocol+
  23. "\n"+
  24. "\nNew Location: "+new_location);
  25. };
  26. location.href = new_location;
  27. })();