Files
Bernd Schoolmann 445a6c5dbf feat(browser): Add a Chrome debug launcher for the extension (#22913)
* feat(browser): Add a Chrome debug launcher for the extension

Loading the unpacked extension by hand into a personal Chrome profile
mixes debug state into real browsing data, and the stable channel now
refuses --load-extension outright.

dev-chrome.mjs launches Chrome for Testing against an isolated profile
under .debug/, reloading the extension as webpack rebuilds. puppeteer is
deliberately not a dependency; the script fails with an install hint.

* address feedback and add vscode launch config

* clean up and remove watch mode

* fix windows launch
2026-09-21 19:17:08 +09:00

62 lines
2.2 KiB
JSON

{
"version": "2.0.0",
"tasks": [
{
// Backing task for the "Desktop: Start and debug" compound: runs the isolated debug
// pipeline (webpack watchers + Electron) so the attach configurations have something
// to attach to.
"label": "desktop: debug start",
"type": "npm",
"script": "debug:desktop",
"path": "",
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"problemMatcher": {
"owner": "desktop-debug",
// The pipeline's own output is already readable in the terminal; nothing here should
// land in the Problems panel, so the pattern is deliberately inert.
"pattern": [{ "regexp": "^$", "file": 1, "location": 2, "message": 3 }],
"background": {
"activeOnStart": true,
"beginsPattern": ".*Building OSS Desktop App.*",
// Electron's main process prints this once --inspect=5858 is listening, which is
// exactly when the debuggers can attach.
"endsPattern": ".*Debugger listening on ws.*"
}
}
},
{
// Backing task for the "Browser: Start and debug" compound: builds the extension and
// launches an isolated Chrome with it loaded, so the attach configuration has
// something to attach to.
"label": "browser: debug start",
"type": "npm",
"script": "debug:browser",
"path": "",
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true
},
"problemMatcher": {
"owner": "browser-debug",
// The pipeline's own output is already readable in the terminal; nothing here should
// land in the Problems panel, so the pattern is deliberately inert.
"pattern": [{ "regexp": "^$", "file": 1, "location": 2, "message": 3 }],
"background": {
"activeOnStart": true,
"beginsPattern": ".*Building extension.*",
// dev-chrome.mjs prints this once Chrome's remote debugging port is listening,
// which is exactly when the debugger can attach.
"endsPattern": ".*DevTools:\\s+http://localhost.*"
}
}
}
]
}