Skip to content

Instantly share code, notes, and snippets.

@xream
Created September 12, 2019 16:33
Show Gist options
  • Save xream/88559091be365b72c94d606c2b310aed to your computer and use it in GitHub Desktop.
Save xream/88559091be365b72c94d606c2b310aed to your computer and use it in GitHub Desktop.
UserScript: VSCode Insiders Install Btn
// ==UserScript==
// @name VSCode Insiders Install Btn
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://marketplace.visualstudio.com/items*
// @grant none
// ==/UserScript==
(function () {
'use strict';
(new MutationObserver(check)).observe(document, {
childList: true,
subtree: true
});
function check(changes, observer) {
const install = document.querySelector('#section-banner > div > table > tbody > tr > td.item-header > div > div.ux-item-action > div.installButtonContainer > div > span.ux-oneclick-install-button-container > a')
if (install) {
install.setAttribute('href', install.getAttribute('href').replace('vscode', 'vscode-insiders'))
observer.disconnect();
// code
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment