Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==UserScript==
// @name github_git_protocol
// @namespace http://tieba.baidu.com/home/main?un=%B9%C8%B8%E7%CE%C0%CA%BF&fr=pb
// @author googleGuard
// @version 1.0
// @include https://github.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
(function(f) {
document.documentElement.appendChild(document.createElement('script')).textContent = '(' + f + ')()';
})(function() {
var add = function(m, n, e, a) {
e = $('.clone-url[data-protocol-type="http"]');
a = $('.js-clone-selector[data-protocol="http"]');
r = e.clone(true).attr('data-protocol-type', m).insertAfter(e).hide();
r.find('strong').text(m);
r.find('.clone').attr('value', function(i, j) {
return j.replace('https://github.com/', n);
}).next().attr('data-clipboard-text', function(i, j) {
return j.replace('https://github.com/', n);
});
a.clone(true).attr('data-protocol', m).text(m).insertAfter(a).clone(true).text(', ').contents().insertAfter(a);
};
add('GIT', 'git://github.com/');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.