GolangDoc redirect

Redirects golang.org/pkg documentation to godoc.org

  1. // ==UserScript==
  2. // @description Redirects golang.org/pkg documentation to godoc.org
  3. // @name GolangDoc redirect
  4. // @namespace Backend
  5. // @include http://golang.org/pkg/*
  6. // @include https://golang.org/pkg/*
  7. // @version 1.0
  8. // @run-at document-start
  9. // @grant none
  10. // ==/UserScript==
  11. var a = 0;
  12. setInterval(function () {
  13. if (a === 0 && window.location.href.indexOf('pkg') > -1) {
  14. a = '//godoc.org/' + window.parent.location.href.split('/pkg/')[1];
  15. window.location.replace(a);
  16. }
  17. }, 10);