Skip to content
This repository was archived by the owner on Oct 4, 2026. It is now read-only.

feat: Allow port option for launching chromium browser - #3

Merged
aklinker1 merged 3 commits into
wxt-dev:masterfrom
dever23b:feat-requestedPort
Jul 7, 2024
Merged

aklinker1 merged 3 commits into
wxt-dev:masterfrom
dever23b:feat-requestedPort

Conversation

@dever23b

@dever23b dever23b commented Jul 7, 2024

Copy link
Copy Markdown

This suggestion allows us to specify a port when launching Chrome. While we can easily add the "remote-debugging-port" option to vite.config.ts, the option doesn't get picked up by web-ext and results in a connection failure error shortly after launching a debugging session.

In absence of a port option, web-ext chooses a random port when launching . By specifying a specific port, it makes it easier to attach to the spawned browser with a debugger during testing.

@dever23b

dever23b commented Jul 7, 2024

Copy link
Copy Markdown
Author

To clarify: I want to be able to create a debug workflow in my IDE (VS Code) to attach to the browser that gets spawned. The random ports make this more tedious, because I have to find the random port each time I spawn the browser and update the launch config for the debug environment in VS Code. The underlying chrome-launch dependency that this code uses supports specifying a specific port, so this PR bridges that gap for an easier debugging experience.

@aklinker1 aklinker1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR, thanks. You may also want to open a PR on the original repo, mozilla/web-ext

@aklinker1
aklinker1 merged commit a6e4db9 into wxt-dev:master Jul 7, 2024
@aklinker1

Copy link
Copy Markdown
Member

@dever23b

dever23b commented Jul 7, 2024

Copy link
Copy Markdown
Author

Good PR, thanks. You may also want to open a PR on the original repo, mozilla/web-ext

Thank you. Good idea. I'll work on that soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants