view code in github based on github1s.com
This commit is contained in:
parent
e1f13ca658
commit
f6c76afac4
27
view_github_code_in_vscode
Normal file
27
view_github_code_in_vscode
Normal file
@ -0,0 +1,27 @@
|
||||
// ==UserScript==
|
||||
// @name View Code in GitHUB
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 0.1
|
||||
// @description try to take over the world!
|
||||
// @author You
|
||||
// @match https://github.com/*/*
|
||||
// @grant none
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
var navi = document.getElementsByClassName('file-navigation')
|
||||
console.log(navi)
|
||||
if (navi.length > 0) {
|
||||
navi = navi[0]
|
||||
var node = document.createElement('a')
|
||||
node.className = 'btn btn-primary'
|
||||
node.style = 'margin-left: 0.5rem'
|
||||
node.href = "https://github1s.com" + window.location.pathname
|
||||
node.innerHTML = "View Code"
|
||||
node.target = "_blank"
|
||||
// var sep = navi.getElementsByClassName('flex-auto')[0]
|
||||
// navi.insertBefore(node, sep.nextSibling)
|
||||
navi.appendChild(node)
|
||||
}
|
||||
})();
|
||||
Loading…
Reference in New Issue
Block a user