Skip to content

Commit

Permalink
Define the path to the directory that contains the Chrome extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
Antec authored and Antec committed Mar 28, 2024
2 parents 64b9aea + a45ae46 commit 9cce9ed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RuriLib/Blocks/Selenium/Browser/Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ public static class Methods
.Select(ext => Directory.GetCurrentDirectory() + "\\UserData\\ChromeExtensions\\" + ext));
}

// Add each extension to the options
foreach (string extensionPath in extensionFiles)
{
chromeop.AddExtension(extensionPath);
}
}

Check failure on line 86 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

'else' cannot start a statement.

Check failure on line 86 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

Syntax error, '(' expected

Check failure on line 86 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

Invalid expression term 'else'

Check failure on line 86 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

) expected

Check failure on line 86 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

; expected
else
{

Console.WriteLine("UserData/ChromeExtensions directory does not exist.");
return;

// Add each extension to the options
foreach (string extensionPath in extensionFiles)
{
chromeop.AddExtension(extensionPath);
}
}

Check failure on line 98 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

'else' cannot start a statement.

Check failure on line 98 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

Syntax error, '(' expected

Check failure on line 98 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

Invalid expression term 'else'

Check failure on line 98 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

) expected

Check failure on line 98 in RuriLib/Blocks/Selenium/Browser/Methods.cs

View workflow job for this annotation

GitHub Actions / test

; expected
else
{

Console.WriteLine("UserData/ChromeExtensions directory does not exist.");
return;

// Initialize the Chrome driver with the options

if (data.ConfigSettings.BrowserSettings.DismissDialogs)
Expand Down
2 changes: 2 additions & 0 deletions RuriLib/Models/Configs/Settings/BrowserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ public class BrowserSettings
public bool LoadOnlyDocumentAndScript { get; set; } = false;
public bool DismissDialogs { get; set; } = false;
public List<string> BlockedUrls { get; set; } = new();

public List<string> ChromeExtensions { get; set; } = new();
}
}

0 comments on commit 9cce9ed

Please sign in to comment.