Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 tasks done
RifHut opened this issue Sep 6, 2024 · 0 comments
Open
5 tasks done

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

RifHut opened this issue Sep 6, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request lib:rurilib RuriLib project

Comments

@RifHut
Copy link

RifHut commented Sep 6, 2024

This feature request respects the following points:

  • 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.
  • This issue is not already reported on GitHub (I've searched it).
  • 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.
  • I agree to follow OpenBullet's Code of Conduct.
  • 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 RifHut added the enhancement New feature or request label Sep 6, 2024
@openbullet openbullet self-assigned this Sep 7, 2024
@openbullet openbullet added the lib:rurilib RuriLib project label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib:rurilib RuriLib project
Projects
Status: Backlog
Development

No branches or pull requests

2 participants