HTTPouëtS

Simple HTTPS redirection and rewrite for Pouët links.

  1. // ==UserScript==
  2. // @name HTTPouëtS
  3. // @version 1.1
  4. // @released 2014-01-23
  5. // @author raina
  6. // @description Simple HTTPS redirection and rewrite for Pouët links.
  7. // @namespace http://userscripts.org/users/315152
  8. // @include *://www.pouet.net/*
  9. // @run-at document-start
  10. // @grant none
  11. // ==/UserScript==
  12. (function() {
  13. "use strict";
  14.  
  15. var httpsize = function(target) {
  16. if (target.href.match(/^http:\/\/(www\.)?pouet\.net/)) {
  17. target.href = target.href.replace(/^http:/, 'https:');
  18. }
  19. };
  20. var sayA = function() {
  21. var as = document.getElementsByTagName('a');
  22. for (var i = 0; i < as.length; i++) {
  23. httpsize(as[i]);
  24. }
  25. };
  26.  
  27. httpsize(window.location);
  28.  
  29. window.addEventListener('load', sayA, false);
  30. }());