Skip to content

Instantly share code, notes, and snippets.

@robertgzr
Last active March 31, 2019 19:18
Show Gist options
  • Save robertgzr/b75103f02445f60478e338452449ab22 to your computer and use it in GitHub Desktop.
Save robertgzr/b75103f02445f60478e338452449ab22 to your computer and use it in GitHub Desktop.
user.js

userscripts for greasemonkey

// ==UserScript==
// @description Redirects golang.org/pkg documentation to godoc.org
// @name GolangDoc redirect
// @namespace gist.github.com/robertgzr
// @homepage gist.github.com/robertgzr/b75103f02445f60478e338452449ab22
// @include http://golang.org/pkg/*
// @include https://golang.org/pkg/*
// @version 1.0
// @run-at document-start
// @grant none
// @downloadURL https://gist.github.com/robertgzr/b75103f02445f60478e338452449ab22/raw/godoc-redirect.user.js
// @updateURL https://gist.github.com/robertgzr/b75103f02445f60478e338452449ab22/raw/godoc-redirect.user.js
// ==/UserScript==
var a = 0;
setInterval(function () {
if (a === 0 && window.location.href.indexOf('pkg') > -1) {
a = '//godoc.org/' + window.parent.location.href.split('/pkg/')[1];
window.location.replace(a);
}
}, 10);
// ==UserScript==
// @description Redirects solus-project.com to getsol.us
// @name SolusProject redirect
// @namespace gist.github.com/robertgzr
// @homepage gist.github.com/robertgzr/b75103f02445f60478e338452449ab22
// @include http://*.solus-project.com/*
// @include https://*.solus-project.com/*
// @version 1.0
// @run-at document-start
// @grant none
// @downloadURL https://gist.github.com/robertgzr/b75103f02445f60478e338452449ab22/raw/solus-redirect.user.js
// @updateURL https://gist.github.com/robertgzr/b75103f02445f60478e338452449ab22/raw/solus-redirect.user.js
// ==/UserScript==
var a = 0;
setInterval(function () {
if (a === 0 && window.location.href.indexOf('.com/') > -1) {
a = '//getsol.us/' + window.parent.location.href.split('.com/')[1];
window.location.replace(a);
}
}, 10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment