Skip to content

Instantly share code, notes, and snippets.

@aiexz
Created February 10, 2021 10:49
Show Gist options
  • Save aiexz/17716b02c02ce56df76d77b858f88fa8 to your computer and use it in GitHub Desktop.
Save aiexz/17716b02c02ce56df76d77b858f88fa8 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name View in VSCode
// @version 1.0
// @description Option to view repository in online vscode instance
// @author @aiexz
// @match https://github.com/*
// @grant None
// ==/UserScript==
(function() {
//'use strict';
var x = document.getElementsByClassName("file-navigation mb-3 d-flex flex-items-start");
if (x.length){
x = x[0]
var btn = document.createElement("a")
btn.className = "btn ml-2 d-none d-md-block"
btn.href = window.location.href.replace("github.com", "github1s.com");
btn.text = "VSCode online";
x.insertBefore(btn, x.children[x.children.length -1]);
}
})();
@aiexz
Copy link
Author

aiexz commented Feb 10, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment