Bug 255962 - run-minibrowser: improve how extra parameters are passed to the minibrowser
Summary: run-minibrowser: improve how extra parameters are passed to the minibrowser
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords:
Depends on:
Blocks: 249031
  Show dependency treegraph
 
Reported: 2023-04-25 16:49 PDT by Carlos Alberto Lopez Perez
Modified: 2023-11-07 14:00 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2023-04-25 16:49:30 PDT
Currently the script run-minibrowser passed to the minibrowser any extra parameter not recognized by the script, which in theory is fine but in some cases it causes issues.

For example, on WPE, is not possible to properly execute Cog with another platform plugins and a custom URL.

Example 1)

$ Tools/Scripts/run-minibrowser --wpe -P drm https://spyber.com

This ends executing "cog -P https://spyber.com drm" because the script picks the first parameter without a dash as the URL (so it thinks "drm" is the URL)


$ Tools/Scripts/run-minibrowser --wpe --platform=drm https://spyber.com

This gives error because --platform is a parameter that the script wants to parse itself instead of passing it to cog (it checks for platform in [wpe, gtk, mac, etc]))


The only possible way of doing it is inverting the order

$ Tools/Scripts/run-minibrowser --wpe https://spyber.com -P drm 


Which is far from evident unless you know the issue.


We can improve this by allowing to specify something like this:

Tools/Scripts/run-minibrowser --wpe --minibrowser-args="-P drm" https://spyber.com


That way there is no confusion and we can even pass to cog parameters like --minibrowser-args='--help' so we can get Cog to print its own help instead of getting the help from the script run-minibrowser
Comment 1 Carlos Alberto Lopez Perez 2023-04-25 17:13:43 PDT
Pull request: https://github.com/WebKit/WebKit/pull/13181
Comment 2 Philippe Normand 2023-04-26 01:15:38 PDT
I don't think this patch is needed?

You can use --:

run-minibrowser --wpe https://spyber.com -- -P wl
Comment 3 Carlos Alberto Lopez Perez 2023-04-28 04:03:52 PDT
I didn't knew about this. Thanks for the pointer! :)

I have submitted a PR to document this feature to bug 256086

And ended going with a different approach for configuring cog via environment variables at bug 256043

(which I think is better in the end as it also works with cog directly instead of relying on the run-minibrowser script)

Closing this as wontfix
Comment 4 Karl Dubost 2023-11-07 03:04:33 PST
the -- argument is not working as far as I know and it's pretty destructive on the list of arguments.
Comment 5 Philippe Normand 2023-11-07 03:22:07 PST
(In reply to Karl Dubost from comment #4)
> the -- argument is not working as far as I know and it's pretty destructive
> on the list of arguments.

Can you provide any detail about this? What is the error?
Comment 6 Karl Dubost 2023-11-07 14:00:35 PST
Philippe,
see Bug 264325 Comment #2