🏠 Home 

VSCode Marketplace - VSCode Insiders Install

Add a persistent button to install extensions directly into VSCode Insiders from the marketplace.


Install this script?
  1. // ==UserScript==
  2. // @name VSCode Marketplace - VSCode Insiders Install
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Add a persistent button to install extensions directly into VSCode Insiders from the marketplace.
  6. // @author @tonycody
  7. // @match https://marketplace.visualstudio.com/items*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. (function () {
  12. 'use strict';
  13. // The selector for the install button
  14. const installButtonSelector = 'a.install';
  15. // A class to identify the Insiders button
  16. const insidersButtonClass = 'install-insiders';
  17. const labelClass = '.ms-Button-label'
  18. // Function to add the Insiders install button if it doesn't exist
  19. function addInsidersInstallButton() {
  20. const installButton = document.querySelector(installButtonSelector);
  21. const alreadyAdded = document.querySelector('.' + insidersButtonClass);
  22. // Only add the button if it doesn't already exist
  23. if (installButton && !alreadyAdded) {
  24. const insidersButton = installButton.cloneNode(true);
  25. // Add a class to identify the button
  26. insidersButton.classList.add(insidersButtonClass);
  27. insidersButton.setAttribute('href', insidersButton.getAttribute('href').replace('vscode:', 'vscode-insiders:'));
  28. insidersButton.style.marginLeft = '3px';
  29. const lbl = insidersButton.querySelector(labelClass)
  30. lbl.innerText = 'Install(Insiders)'
  31. installButton.parentNode.insertBefore(insidersButton, installButton.nextSibling);
  32. }
  33. }
  34. // Create an observer instance linked to the callback function
  35. const observer = new MutationObserver(function (mutations, me) {
  36. // Retry adding the Insiders install button
  37. addInsidersInstallButton();
  38. });
  39. // Start observing the document body and check for DOM changes
  40. observer.observe(document.body, {
  41. childList: true,
  42. subtree: true
  43. });
  44. // Initial try to add the button
  45. addInsidersInstallButton();
  46. })();