<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>255962</bug_id>
          
          <creation_ts>2023-04-25 16:49:30 -0700</creation_ts>
          <short_desc>run-minibrowser: improve how extra parameters are passed to the minibrowser</short_desc>
          <delta_ts>2023-11-07 14:00:35 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=256043</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=264325</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>249031</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Carlos Alberto Lopez Perez">clopez</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>karlcow</cc>
    
    <cc>philn</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1951205</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2023-04-25 16:49:30 -0700</bug_when>
    <thetext>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 &quot;cog -P https://spyber.com drm&quot; because the script picks the first parameter without a dash as the URL (so it thinks &quot;drm&quot; 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=&quot;-P drm&quot; https://spyber.com


That way there is no confusion and we can even pass to cog parameters like --minibrowser-args=&apos;--help&apos; so we can get Cog to print its own help instead of getting the help from the script run-minibrowser</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951214</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2023-04-25 17:13:43 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/13181</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951289</commentid>
    <comment_count>2</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2023-04-26 01:15:38 -0700</bug_when>
    <thetext>I don&apos;t think this patch is needed?

You can use --:

run-minibrowser --wpe https://spyber.com -- -P wl</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1951791</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2023-04-28 04:03:52 -0700</bug_when>
    <thetext>I didn&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1990493</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-11-07 03:04:33 -0800</bug_when>
    <thetext>the -- argument is not working as far as I know and it&apos;s pretty destructive on the list of arguments.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1990496</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2023-11-07 03:22:07 -0800</bug_when>
    <thetext>(In reply to Karl Dubost from comment #4)
&gt; the -- argument is not working as far as I know and it&apos;s pretty destructive
&gt; on the list of arguments.

Can you provide any detail about this? What is the error?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1990648</commentid>
    <comment_count>6</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-11-07 14:00:35 -0800</bug_when>
    <thetext>Philippe,
see Bug 264325 Comment #2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>