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

Maximum of one argument can be passed to Chromium. #142

Open
steviator opened this issue Dec 12, 2024 · 4 comments
Open

Maximum of one argument can be passed to Chromium. #142

steviator opened this issue Dec 12, 2024 · 4 comments

Comments

@steviator
Copy link

steviator commented Dec 12, 2024

For no apparent reason there is a limit of one chromium argument. When trying to specify multiple arguments browservice arbitrarily and needlessly disallows specifying more than one argument, pointlessly deliberately limiting its usefulness.

I would expect that browservice would accept multiple arguments by some means like

browservice --chromium-args=proxy-server="http://localhost:8100" --chromium-args="force-device-scale-factor=0.79"
or
browservice --chromium-args=proxy-server="http://localhost:8100","force-device-scale-factor=0.79"

Instead, browservice simply refuses to start, returning an error....

ERROR: Option --chromium-args specified multiple times

@ttalvitie
Copy link
Owner

ttalvitie commented Jan 14, 2025

The help explains

  --chromium-args=NAME(=VAL),...        comma-separated extra arguments to be forwarded to Chromium
                                          [default empty]

Thus, multiple comma-separated Chromium arguments given in the same --chromium-args Browservice argument works. (Your first command specifying multiple --chromium-args arguments is not supported, as we can see from the error.) There is nothing "arbitrarily and needlessly disallowing specifying more than one argument"; specifying more than one argument is implemented.

Based on this, your second command seems correct. The only odd thing is the quotes; usually the shell should remove them (at least windows CMD and Bash seems to do that); to know what is happening there I would need to know more about your shell where you run the commands. But I don't think the quotes are needed at all, so I would just try
--chromium-args=proxy-server=http://localhost:8100,force-device-scale-factor=0.79; it seems to work for me at least.

@steviator
Copy link
Author

steviator commented Jan 14, 2025 via email

@ttalvitie
Copy link
Owner

Browservice has set the device scale factor to 1.0 for quite a long time (maybe always?) in https://github.com/ttalvitie/browservice/blob/master/src/browser_area.cpp#L117 (to avoid the host display affecting how Browservice works); hopefully this is not causing the issue (I would guess an option with "force" in its name would override this). If it is any help with the scaling issues, Browservice does support zooming, either with --initial-zoom command line argument or Ctrl+J/K/M.

@steviator
Copy link
Author

While faffing about earlier I accidentally discovered a misfeature that actually allows me to change a lot of settings of chromium, if I run another copy of browservice after browservice is started, a chromium window pops up. If I make config changes in the settings of that chromium Window and then close both open copies of browservice, the config changes are applied to subsequent browservice instances.

This seems like it couldn't possibly be intended behavior, and I haven't experimented with it much, but it may be a secret cheat code that allows the installation of add-ons, as well as an obvious way to confuse and break browservice if not used carefully.

Forcing device scaling to 1.0 makes perfect sense if there's a separate zoom function. --initial-zoom sounds like exactly what I've been looking for all along. I just set zoom using the above secret cheat code, I presume that preference would be overridden by the --initial-zoom argument, which would be much more convenient. Thanks for the explanation - this should solve all my problems.

Thanks again for your valuable time, your help is very much appreciated.

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