Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Define dimensions of autoLaunch window #22

Closed
lokimckay opened this issue Mar 30, 2022 · 3 comments
Closed

[Feature request] Define dimensions of autoLaunch window #22

lokimckay opened this issue Mar 30, 2022 · 3 comments

Comments

@lokimckay
Copy link

I'd like to control the size of the Chrome window that automatically launches when running vite build --watch

I only need a small window to test my extension, but it currently launches as a large window - meaning I have to resize it every time I run the command

Is there already a workaround for this?

@aklinker1
Copy link
Owner

aklinker1 commented Mar 30, 2022

Chrome supports the --window-size argument when launching from the CLI.

web-ext, the tool used to open the browser and install the extension, supports configuring the CLI arguments passed to the browser start command via the --args flag.

To configure this within the plugin:

webExtension({
  manifest: ...,
  webExtConfig: {
    args: ["--window-size=400x300"],
  },
})

This is untested, web-ext's JS docs aren't great, so I'm assuming --args on the CLI maps to a string array called args in the JS config

I see that the webExtConfig option is not documented in the README, I'll add a section for it.

@aklinker1
Copy link
Owner

947b5d9

@lokimckay
Copy link
Author

Thanks very much, the below snippet worked in my case (needed to change x to ,)

webExtension({
  manifest: ...,
  webExtConfig: {
    args: ["--window-size=400,300"],
  },
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants