OpenBullet2 icon indicating copy to clipboard operation
OpenBullet2 copied to clipboard

[REQUEST]: Improve Multi extraCmdLineArgs Function [demo model]

Open RifHut opened this issue 1 year ago • 0 comments

This feature request respects the following points:

  • [X] This is a feature request, not a question or a configuration issue; Please visit our forum first to troubleshoot with volunteers, before creating a report. The links can be found here.
  • [X] This issue is not already reported on GitHub (I've searched it).
  • [X] I'm using an up to date version of OpenBullet2. We generally do not support previous older versions. If possible, please update to the latest version before opening an issue.
  • [X] I agree to follow OpenBullet's Code of Conduct.
  • [X] This report addresses only a single feature request; If you have multiple feature request, kindly create separate reports for each one.

Description of the feature request

When I work with multiple arguments in Selenium, I get an error because of the double quotes in the arguments. For example: --user-data-dir="C:/Users/Me/AppData/Local/Google/Chrome/User Data" and --load-extension="D:/OB2 0.2.5/OpenBullet2.Native/Extensions/Captchaclik". If you leave the double quotes and use chromeOptions.AddArgument(...), the string gets divided by the quotes, and the argument will not work correctly."

Is your feature request related to a problem

of course yes, check the link in the forum : [https://discourse.openbullet.dev/t/how-to-install-multiple-extension-in-puppeter-or-selenium/7035/3](Read more..)

Describe the solution you'd like

so to improve this logic please check my repository https://github.com/RifHut/OpenBullet2/blob/0355ee34a754ac6e753c2ed9877d257248499570/RuriLib/Blocks/Selenium/Browser/Methods.cs#L95

the code like this :


// This regex will split the string by "|" unless the space is within quotes.
                        // Case of Multipe Arguments in extraCmdLineArgs in OpenBrowser Using Selenium Ex: arg1|arg2|arg3...
                        var argsArray = Regex.Matches(args, @"[^|]+")
                                                 .Cast<Match>()
                                             .Select(m => m).ToList();
                       foreach (var match in argsArray) { 
                       // Add the command line arguments to chrome options.
                       chromeop.AddArguments(match.ToString());
                       }`

Describe alternatives you've considered

BLOCK:SeleniumOpenBrowser
  extraCmdLineArgs = $"|--start-maximized |<EXTRARG>|--user-agent=<UAA>|--user-data-dir=C:\\PROFILES\\DATADIR\\BROWSERSDIR\\<input.EMAIL>"
ENDBLOCK

The pipe | separates multiple arguments in chromeOptions.AddArguments using the pipe separator.

Relevant screenshots or videos

No response

Additional information

No response

RifHut avatar Sep 06 '24 22:09 RifHut