Bug 255962

Summary: run-minibrowser: improve how extra parameters are passed to the minibrowser
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: Tools / TestsAssignee: Carlos Alberto Lopez Perez <clopez>
Status: RESOLVED WONTFIX    
Severity: Normal CC: bugs-noreply, karlcow, philn
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=256043
https://bugs.webkit.org/show_bug.cgi?id=264325
Bug Depends on:    
Bug Blocks: 249031    

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