Repository: microsoft/vscode-js-debug (TypeScript)

Issue:
No obvious way to launch Edge as debug browser for terminal link handling in WSL
**Describe the bug**
When using the Debug Terminal with VSCode in WSL remote mode, there was no obvious way to switch the browser option to Edge. I was able to make it work by using the following config:

```json
    "debug.javascript.defaultRuntimeExecutable": {
        "pwa-chrome": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
    },
```

**To Reproduce**
Steps to reproduce the behavior:
1. In Windows, set Edge as your default browser
2. Run VSCode in WSL mode
3. Start a webserver
4. Ctrl+click the advertised hostname
5. See Chrome launches

**VS Code Version:** `v2024.5.217`




Discussion: Can you please let me know the value of [this](https://github.com/sindresorhus/default-browser/blob/08ed0560dfb7ed71e6536902ae312e03920a6929/windows.js#L25) registry key?

We will use Edge automatically if it's set as the platform default browser, but it seems like the detection is not working in your case.
Here's the output of that command:
```sh
reg QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice /v ProgId

HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice
    ProgId    REG_SZ    MSEdgeHTM
```



Fix (patch):
diff --git a/package-lock.json b/package-lock.json
index dccfe99e8..332056be7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -21,7 +21,7 @@
         "astring": "^1.8.6",
         "color": "^4.2.3",
         "data-uri-to-buffer": "^6.0.1",
-        "default-browser": "^2.0.1",
+        "default-browser": "^5.2.1",
         "dotenv": "^16.4.1",
         "eslint-visitor-keys": "^3.4.3",
         "execa": "^5.1.1",
@@ -3562,14 +3562,6 @@
         "platform": "^1.3.3"
       }
     },
-    "node_modules/big-integer": {
-      "version": "1.6.48",
-      "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
-      "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==",
-      "engines": {
-        "node": ">=0.6"
-      }
-    },
     "node_modules/binary-extensions": {
       "version": "1.13.1",
       "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
@@ -3645,14 +3637,6 @@
       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
       "dev": true
     },
-    "node_modules/bplist-parser": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
-      "integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=",
-      "dependencies": {
-        "big-integer": "^1.6.7"
-      }
-    },
     "node_modules/brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -3776,14 +3760,17 @@
       "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
     },
     "node_modules/bundle-name": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-2.0.1.tgz",
-      "integrity": "sha1-vLJUDfM3tXLXFuRo9nU6fO4ziAM=",
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
+      "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
       "dependencies": {
-        "run-applescript": "^2.0.0"
+        "run-applescript": "^7.0.0"
       },
       "engines": {
-        "node": ">=4"
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
     "node_modules/bytes": {
@@ -4520,16 +4507,6 @@
         "node": ">=4.8"
       }
     },
-    "node_modules/cross-spawn-async": {
-      "version": "2.2.5",
-      "resolved": "https://registry.npmjs.org/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz",
-      "integrity": "sha1-hF/wwINKPe2dFg2sptOQkGuyiMw=",
-      "deprecated": "cross-spawn no longer requires a build toolchain, use it instead",
-      "dependencies": {
-        "lru-cache": "^4.0.0",
-        "which": "^1.2.8"
-      }
-    },
     "node_modules/crypt": {
       "version": "0.0.2",
       "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
@@ -4691,29 +4668,29 @@
       "dev": true
     },
     "node_modules/default-browser": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-2.0.1.tgz",
-      "integrity": "sha1-BsvOpZuN23LyLeXXC8hXlz8TnWs=",
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz",
+      "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==",
       "dependencies": {
-        "bundle-name": "^2.0.1",
-        "default-browser-id": "^2.0.0",
-        "xdg-default-browser": "^2.0.0"
+        "bundle-name": "^4.1.0",
+        "default-browser-id": "^5.0.0"
       },
       "engines": {
-        "node": ">=4"
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
     "node_modules/default-browser-id": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-2.0.0.tgz",
-      "integrity": "sha1-AezONxpx6F8VoXF354YwR+c9vn0=",
-      "dependencies": {
-        "bplist-parser": "^0.1.0",
-        "pify": "^2.3.0",
-        "untildify": "^2.0.0"
-      },
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz",
+      "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==",
       "engines": {
-        "node": ">=4"
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
     "node_modules/default-compare": {
@@ -9370,15 +9347,6 @@
         "node": ">=8"
       }
     },
-    "node_modules/lru-cache": {
-      "version": "4.1.5",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
-      "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
-      "dependencies": {
-        "pseudomap": "^1.0.2",
-        "yallist": "^2.1.2"
-      }
-    },
     "node_modules/make-dir": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -11088,6 +11056,7 @@
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
       "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -11490,14 +11459,6 @@
         "safe-buffer": "~5.1.0"
       }
     },
-    "node_modules/os-homedir": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
-      "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/os-locale": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
@@ -11839,6 +11800,7 @@
       "version": "2.3.0",
       "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
       "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -11847,6 +11809,7 @@
       "version": "2.0.4",
       "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
       "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -11855,6 +11818,7 @@
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
       "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+      "dev": true,
       "dependencies": {
         "pinkie": "^2.0.0"
       },
@@ -12203,11 +12167,6 @@
         "node": ">= 0.10"
       }
     },
-    "node_modules/pseudomap": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
-      "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
-    },
     "node_modules/pump": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
@@ -12756,15 +12715,14 @@
       }
     },
     "node_modules/run-applescript": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-2.1.0.tgz",
-      "integrity": "sha1-O/8sz5W2zqy0lyPlUPADcdYYUQ0=",
-      "dependencies": {
-        "pify": "^2.2.0",
-        "pinkie-promise": "^2.0.0"
-      },
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz",
+      "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==",
       "engines": {
-        "node": ">=0.10.0"
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
     "node_modules/run-parallel": {
@@ -13808,14 +13766,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/strip-eof": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
-      "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/strip-final-newline": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
@@ -14005,14 +13955,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/titleize": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/titleize/-/titleize-1.0.1.tgz",
-      "integrity": "sha512-rUwGDruKq1gX+FFHbTl5qjI7teVO7eOe+C8IcQ7QT+1BK3eEUXJqbZcBOeaRP4FwSC/C1A5jDoIVta0nIQ9yew==",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/tmp": {
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
@@ -14998,17 +14940,6 @@
         "node": ">=0.10.0"
       }
     },
-    "node_modules/untildify": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz",
-      "integrity": "sha1-F+soB5h/dpUunASF/DEdBqgmouA=",
-      "dependencies": {
-        "os-homedir": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/upath": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
@@ -15392,6 +15323,7 @@
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
       "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+      "dev": true,
       "dependencies": {
         "isexe": "^2.0.0"
       },
@@ -15647,52 +15579,6 @@
         }
       }
     },
-    "node_modules/xdg-default-browser": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/xdg-default-browser/-/xdg-default-browser-2.1.0.tgz",
-      "integrity": "sha1-QaBXuNoRKGEOzpsywTalLkLg0VI=",
-      "dependencies": {
-        "execa": "^0.2.2",
-        "titleize": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/xdg-default-browser/node_modules/execa": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/execa/-/execa-0.2.2.tgz",
-      "integrity": "sha1-4urUcsLDGq1vc/GslW7vReEjIMs=",
-      "dependencies": {
-        "cross-spawn-async": "^2.1.1",
-        "npm-run-path": "^1.0.0",
-        "object-assign": "^4.0.1",
-        "path-key": "^1.0.0",
-        "strip-eof": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=0.12"
-      }
-    },
-    "node_modules/xdg-default-browser/node_modules/npm-run-path": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-1.0.0.tgz",
-      "integrity": "sha1-9cMr9ZX+ga6Sfa7FLoL4sACsPI8=",
-      "dependencies": {
-        "path-key": "^1.0.0"
-      },
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/xdg-default-browser/node_modules/path-key": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz",
-      "integrity": "sha1-XVPVeAGWRsDWiADbThRua9wqx68=",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/xml": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz",
@@ -15736,11 +15622,6 @@
       "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
       "dev": true
     },
-    "node_modules/yallist": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
-      "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
-    },
     "node_modules/yargs": {
       "version": "7.1.0",
       "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
@@ -18438,11 +18319,6 @@
         "platform": "^1.3.3"
       }
     },
-    "big-integer": {
-      "version": "1.6.48",
-      "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz",
-      "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w=="
-    },
     "binary-extensions": {
       "version": "1.13.1",
       "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz",
@@ -18513,14 +18389,6 @@
       "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
       "dev": true
     },
-    "bplist-parser": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz",
-      "integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=",
-      "requires": {
-        "big-integer": "^1.6.7"
-      }
-    },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -18607,11 +18475,11 @@
       "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
     },
     "bundle-name": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-2.0.1.tgz",
-      "integrity": "sha1-vLJUDfM3tXLXFuRo9nU6fO4ziAM=",
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz",
+      "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==",
       "requires": {
-        "run-applescript": "^2.0.0"
+        "run-applescript": "^7.0.0"
       }
     },
     "bytes": {
@@ -19214,15 +19082,6 @@
         "which": "^1.2.9"
       }
     },
-    "cross-spawn-async": {
-      "version": "2.2.5",
-      "resolved": "https://registry.npmjs.org/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz",
-      "integrity": "sha1-hF/wwINKPe2dFg2sptOQkGuyiMw=",
-      "requires": {
-        "lru-cache": "^4.0.0",
-        "which": "^1.2.8"
-      }
-    },
     "crypt": {
       "version": "0.0.2",
       "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
@@ -19333,24 +19192,18 @@
       "dev": true
     },
     "default-browser": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-2.0.1.tgz",
-      "integrity": "sha1-BsvOpZuN23LyLeXXC8hXlz8TnWs=",
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz",
+      "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==",
       "requires": {
-        "bundle-name": "^2.0.1",
-        "default-browser-id": "^2.0.0",
-        "xdg-default-browser": "^2.0.0"
+        "bundle-name": "^4.1.0",
+        "default-browser-id": "^5.0.0"
       }
     },
     "default-browser-id": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-2.0.0.tgz",
-      "integrity": "sha1-AezONxpx6F8VoXF354YwR+c9vn0=",
-      "requires": {
-        "bplist-parser": "^0.1.0",
-        "pify": "^2.3.0",
-        "untildify": "^2.0.0"
-      }
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz",
+      "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA=="
     },
     "default-compare": {
       "version": "1.0.0",
@@ -22956,15 +22809,6 @@
       "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz",
       "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="
     },
-    "lru-cache": {
-      "version": "4.1.5",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
-      "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
-      "requires": {
-        "pseudomap": "^1.0.2",
-        "yallist": "^2.1.2"
-      }
-    },
     "make-dir": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -24276,7 +24120,8 @@
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+      "dev": true
     },
     "object-copy": {
       "version": "0.1.0",
@@ -24583,11 +24428,6 @@
         }
       }
     },
-    "os-homedir": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
-      "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
-    },
     "os-locale": {
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
@@ -24841,17 +24681,20 @@
     "pify": {
       "version": "2.3.0",
       "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
-      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
+      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+      "dev": true
     },
     "pinkie": {
       "version": "2.0.4",
       "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
-      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
+      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+      "dev": true
     },
     "pinkie-promise": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
       "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+      "dev": true,
       "requires": {
         "pinkie": "^2.0.0"
       }
@@ -25105,11 +24948,6 @@
         "ipaddr.js": "1.9.1"
       }
     },
-    "pseudomap": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
-      "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
-    },
     "pump": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
@@ -25534,13 +25372,9 @@
       "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw=="
     },
     "run-applescript": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-2.1.0.tgz",
-      "integrity": "sha1-O/8sz5W2zqy0lyPlUPADcdYYUQ0=",
-      "requires": {
-        "pify": "^2.2.0",
-        "pinkie-promise": "^2.0.0"
-      }
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz",
+      "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A=="
     },
     "run-parallel": {
       "version": "1.2.0",
@@ -26376,11 +26210,6 @@
         "is-utf8": "^0.2.0"
       }
     },
-    "strip-eof": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
-      "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
-    },
     "strip-final-newline": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz",
@@ -26543,11 +26372,6 @@
       "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=",
       "dev": true
     },
-    "titleize": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/titleize/-/titleize-1.0.1.tgz",
-      "integrity": "sha512-rUwGDruKq1gX+FFHbTl5qjI7teVO7eOe+C8IcQ7QT+1BK3eEUXJqbZcBOeaRP4FwSC/C1A5jDoIVta0nIQ9yew=="
-    },
     "tmp": {
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz",
@@ -27173,14 +26997,6 @@
         }
       }
     },
-    "untildify": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/untildify/-/untildify-2.1.0.tgz",
-      "integrity": "sha1-F+soB5h/dpUunASF/DEdBqgmouA=",
-      "requires": {
-        "os-homedir": "^1.0.0"
-      }
-    },
     "upath": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
@@ -27497,6 +27313,7 @@
       "version": "1.3.1",
       "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
       "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+      "dev": true,
       "requires": {
         "isexe": "^2.0.0"
       }
@@ -27690,42 +27507,6 @@
       "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==",
       "requires": {}
     },
-    "xdg-default-browser": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/xdg-default-browser/-/xdg-default-browser-2.1.0.tgz",
-      "integrity": "sha1-QaBXuNoRKGEOzpsywTalLkLg0VI=",
-      "requires": {
-        "execa": "^0.2.2",
-        "titleize": "^1.0.0"
-      },
-      "dependencies": {
-        "execa": {
-          "version": "0.2.2",
-          "resolved": "https://registry.npmjs.org/execa/-/execa-0.2.2.tgz",
-          "integrity": "sha1-4urUcsLDGq1vc/GslW7vReEjIMs=",
-          "requires": {
-            "cross-spawn-async": "^2.1.1",
-            "npm-run-path": "^1.0.0",
-            "object-assign": "^4.0.1",
-            "path-key": "^1.0.0",
-            "strip-eof": "^1.0.0"
-          }
-        },
-        "npm-run-path": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-1.0.0.tgz",
-          "integrity": "sha1-9cMr9ZX+ga6Sfa7FLoL4sACsPI8=",
-          "requires": {
-            "path-key": "^1.0.0"
-          }
-        },
-        "path-key": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz",
-          "integrity": "sha1-XVPVeAGWRsDWiADbThRua9wqx68="
-        }
-      }
-    },
     "xml": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz",
@@ -27760,11 +27541,6 @@
       "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==",
       "dev": true
     },
-    "yallist": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
-      "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
-    },
     "yargs": {
       "version": "7.1.0",
       "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz",
diff --git a/package.json b/package.json
index 1b3acff17..12d6d6c80 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,7 @@
     "astring": "^1.8.6",
     "color": "^4.2.3",
     "data-uri-to-buffer": "^6.0.1",
-    "default-browser": "^2.0.1",
+    "default-browser": "^5.2.1",
     "dotenv": "^16.4.1",
     "eslint-visitor-keys": "^3.4.3",
     "execa": "^5.1.1",
diff --git a/src/common/defaultBrowserProvider.ts b/src/common/defaultBrowserProvider.ts
index 187ce420d..74f02900f 100644
--- a/src/common/defaultBrowserProvider.ts
+++ b/src/common/defaultBrowserProvider.ts
@@ -2,41 +2,17 @@
  * Copyright (C) Microsoft Corporation. All rights reserved.
  *--------------------------------------------------------*/
 
-import defaultBrowserModule from 'default-browser';
-import { injectable, inject } from 'inversify';
-import { Execa } from '../ioc-extras';
-import type execaType from 'execa';
-import { ChildProcessError } from './processUtils';
+import { inject, injectable, optional } from 'inversify';
+import type * as vscodeType from 'vscode';
+import { ExtensionLocation, VSCodeApi } from '../ioc-extras';
 import { once } from './objUtils';
 
 export const enum DefaultBrowser {
-  Chrome,
-  Safari,
-  Firefox,
-  Edge,
-  OldEdge,
-  IE,
+  Edge = 'edge',
+  Chrome = 'chrome',
+  Other = 'other',
 }
 
-const substrings = new Map([
-  ['chrome', DefaultBrowser.Chrome],
-  ['safari', DefaultBrowser.Safari],
-  ['firefox', DefaultBrowser.Firefox],
-  ['msedge', DefaultBrowser.Edge],
-  ['microsoft edge', DefaultBrowser.Edge],
-  ['appxq0fevzme2pys62n3e0fbqa7peapykr8v', DefaultBrowser.OldEdge],
-  ['ie.http', DefaultBrowser.IE],
-]);
-
-const getMatchingBrowserInString = (str: string) => {
-  str = str.toLowerCase();
-  for (const [needle, browser] of substrings.entries()) {
-    if (str.includes(needle)) {
-      return browser;
-    }
-  }
-};
-
 /**
  * Class that looks up the default browser on the current platform.
  */
@@ -53,8 +29,8 @@ export const IDefaultBrowserProvider = Symbol('IDefaultBrowserProvider');
 @injectable()
 export class DefaultBrowserProvider implements IDefaultBrowserProvider {
   constructor(
-    @inject(Execa) private readonly execa: typeof execaType,
-    private readonly platform = process.platform,
+    @inject(ExtensionLocation) private readonly location: ExtensionLocation,
+    @optional() @inject(VSCodeApi) private readonly vscode?: typeof vscodeType,
   ) {}
 
   /**
@@ -63,35 +39,17 @@ export class DefaultBrowserProvider implements IDefaultBrowserProvider {
    * default browser.
    * @inheritdoc
    */
-  public lookup = once(() => {
-    if (this.platform === 'win32') {
-      return this.lookupWindows();
+  public lookup = once(async () => {
+    let name: string;
+    if (this.location === 'remote' && this.vscode) {
+      name = await this.vscode.commands.executeCommand('js-debug-companion.defaultBrowser');
     } else {
-      return this.lookupUnix();
-    }
-  });
-
-  private async lookupUnix() {
-    const { name } = await defaultBrowserModule();
-    return getMatchingBrowserInString(name);
-  }
-
-  private async lookupWindows() {
-    const result = await this.execa('reg', [
-      'QUERY',
-      ' HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice',
-      '/v',
-      'ProgId',
-    ]);
-    if (result.failed) {
-      throw ChildProcessError.fromExeca(result);
+      name = (await import('default-browser').then(d => d.default())).name;
     }
 
-    const match = /ProgId\s*REG_SZ\s*(\S+)/.exec(result.stdout);
-    if (!match) {
-      return undefined;
-    }
-
-    return getMatchingBrowserInString(match[1]);
-  }
+    const match = [DefaultBrowser.Chrome, DefaultBrowser.Edge].find(browser =>
+      name.toLowerCase().includes(browser),
+    );
+    return match ?? DefaultBrowser.Other;
+  });
 }
diff --git a/src/typings/default-browser.d.ts b/src/typings/default-browser.d.ts
deleted file mode 100644
index 0c5f64be9..000000000
--- a/src/typings/default-browser.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-declare module 'default-browser' {
-  function lookup(): Promise<{ name: string, id: string }>;
-
-  export = lookup;
-}