Greasy Fork is available in English.

Install VS Code Extensions in Cursor

Changes the install button to install in Cursor

  1. // ==UserScript==
  2. // @name Install VS Code Extensions in Cursor
  3. // @namespace rasmusbe/vscode-cursor
  4. // @version 2025-03-05
  5. // @license MIT
  6. // @description Changes the install button to install in Cursor
  7. // @match https://marketplace.visualstudio.com/items?itemName=*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=visualstudio.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. const observeDOM = (function() {
  16. const MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
  17.  
  18. return function(obj, callback) {
  19. if (!obj || obj.nodeType !== 1) {
  20. return;
  21. }
  22.  
  23. if (MutationObserver) {
  24. // define a new observer
  25. const mutationObserver = new MutationObserver(callback);
  26.  
  27. // have the observer observe for changes in children
  28. mutationObserver.observe(obj, {childList: true, subtree: true});
  29. return mutationObserver;
  30. } else if (window.addEventListener) { // browser support fallback
  31. obj.addEventListener('DOMNodeInserted', callback, false);
  32. obj.addEventListener('DOMNodeRemoved', callback, false);
  33. }
  34. }
  35. })();
  36.  
  37. const fixLink = () => {
  38. const installButton = document.querySelector("a.install");
  39. installButton.href = installButton.href.replace(/^vscode:/, "cursor:")
  40. }
  41. fixLink();
  42.  
  43. const reactRoot = document.querySelector("[data-reactroot]");
  44. observeDOM(reactRoot, function(m) {
  45. fixLink();
  46. });
  47. })();