allow winebrowser to use commands with arguments

Yuriy yuriy.kozlov at gmail.com
Mon Jan 15 17:27:32 CST 2007


Hello,

This is a combination of my last two tries at the patch:
This version:
 - changes the browser list to a REG_MULTI_SZ value
 - if it is not a REG_MULTI_SZ, the old behavior remains for now
 - if there are arguments, the name of the browser should be in quotes
 - if there is a %s or %u, the url is placed there rather than at the end
 - any number of arguments.
 - uses strsep instead of parsing the string manually
 - correctly creates the registry value if it is not there

"Browsers"=x-www-browser,xdg-open,"firefox"%u,"firefox" -remote
openURL(%s,new-tab),"kfmclient"  openProfile webbrowsing
%s,konqueror,"kfmclient" openURL,mozilla,netscape,galeon,opera,dillo

Any of the above entered in a REG_MULTI_SZ value (tested by putting
the hex values of the characters in a .reg file) will launch correctly
with this patch.

This is the above as I tested it (the first few arguments are
intentionally mispelled, this registry value should make winebrowser
launch konqueror):
[HKEY_USERS\S-1-5-4\Software\Wine\WineBrowser]
"Browsers"=hex(7):78,2d,77,79,77,2d,62,72,6f,77,73,65,72,00,78,64,67,2d,6f,70,65,00,22,66,69,72,65,66,6f,70,22,25,75,00,22,66,69,72,65,66,6f,79,22,20,2d,72,65,6d,6f,74,65,20,6f,70,65,6e,55,52,4c,28,25,73,2c,6e,65,77,2d,74,61,62,29,00,22,6b,66,6d,63,6c,69,65,6e,74,22,20,20,6f,70,65,6e,50,72,6f,66,69,6c,65,20,77,65,62,62,72,6f,77,73,69,6e,67,20,25,73,00,6b,6f,6e,71,75,65,72,6f,72,00,6b,66,6d,63,6c,69,65,63,74,20,6f,70,65,6e,55,52,4c,00,6d,6f,7a,69,6c,6c,61,00,63,65,74,73,63,61,70,65,00,67,61,6c,65,6f,63,00,6f,70,65,71,61,00,64,69,6c,6c,6f

CHANGELOG:
allow winebrowser to use commands with arguments


On 1/10/07, Yuriy <yuriy.kozlov at gmail.com> wrote:
> Hello,
>
> Here is another try at the patch.
> The attached patch allows using multi-argument commands for winebrowser and:
> - keeps the current format (unlike the last patch)
> - if there is a %s or %u, the url is placed there rather than at the end
> - any number of arguments
> - if a comma is needed, it can be inserted with %c (currently, there
> is no way to have a comma)
> - blank application values or extra spaces between arguments do not
> cause problems
> - uses strsep instead of parsing the string manually
>
> An example winebrowser registry value:
> "Browsers"=", ,x-www-browser,xdg-open,firefox %u, firefox -remote
> openURL(%s%cnew-tab),kfmclient  openProfile webbrowsing
> %s,konqueror,kfmclient openURL,mozilla,netscape,galeon,opera,dillo"
>
> Any of the above will launch correctly with this patch.
>
> CHANGELOG:
> allow winebrowser to use commands with arguments
>
>
> On 9/11/06, Yuriy <yuriy.kozlov at gmail.com> wrote:
> > Hello,
> >
> > I have corrected some problems with the patch and accounted for more
> > possibilities.  The attached patch allows using multi-argument
> > commands for winebrowser and:
> > - changes the browser list to a REG_MULTI_SZ value
> > - if it is not a REG_MULTI_SZ, the old behavior remains for now
> > - if there are arguments, the name of the browser should be in quotes
> > - if there is a %s, the url is placed there rather than at the end
> > - any number of arguments.
> >
> > On 8/11/06, Yuriy <yuriy.kozlov at gmail.com> wrote:
> > > Hello,
> > > I fixed a bug that wasn't allowing multi-word commands to be used as a
> > > browser for winebrowser, which are needed for things such as launching
> > > the KDE default browser or a new tab in opera.  This is my first time
> > > writing more than a couple lines of C, so my patch probably warrants
> > > some extra scrutiny.
> > >
> > >
> > > PROBLEM:
> > > winebrowser doesn't work with browsers/commands that
> > > are more than one word.  For example, the command to run konqueror
> > > with the webbrowsing profile on kubuntu is:
> > >
> > > kfmclient openProfile webbrowsing [url]
> > >
> > > Setting that to be the first attempted webbrowser in the registry:
> > >
> > > [HKEY_USERS\S-1-5-4\Software\Wine\WineBrowser]
> > > "Browsers"="kfmclient openProfile webbrowsing,firefox,mozilla,opera,dillo"
> > >
> > > and running:
> > > winebrowser http://www.winehq.org
> > >
> > > yields this:
> > > Considering: kfmclient openProfile webbrowsing
> > > argv[1]: http://www.winehq.org
> > > Considering: firefox
> > > argv[1]: http://www.winehq.org
> > >
> > >
> > > DESCRIPTION:
> > > This patch parses the app to seperate the arguments.  It allows up to
> > > 5 arguments including the app name.  It sends all the arguments to the
> > > spawn function and preserves the app name to display.
> > >
> > >
> > > CHANGE:
> > > allow winebrowser to use commands with arguments
> >
> >
> >
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winebrowserarguments2.diff
Type: application/octet-stream
Size: 6556 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20070115/d7373ce0/winebrowserarguments2.obj


More information about the wine-patches mailing list