From 07f25c219a1e59b25c3ef7545243436cac2f8f27 Mon Sep 17 00:00:00 2001 From: mbvyd <8224359-mbvyd@users.noreply.gitlab.com> Date: Mon, 8 May 2023 10:45:16 +0300 Subject: [PATCH] added alternative way of loading --- SeleniumProxyAuthentication/ProxyAuthentication.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/SeleniumProxyAuthentication/ProxyAuthentication.cs b/SeleniumProxyAuthentication/ProxyAuthentication.cs index b1ae946..5b23388 100644 --- a/SeleniumProxyAuthentication/ProxyAuthentication.cs +++ b/SeleniumProxyAuthentication/ProxyAuthentication.cs @@ -16,7 +16,7 @@ public static class ProxyAuthentication /// You Can Use Edge or Chrome for now /// Your Proxy With This Format host:port or host:port:user:pass as string /// Edit Chrome Extension Manifest File (Leave it Empty If You Don't Want To Change It) - public static void AddProxyAuthenticationExtension(this T browserOption, Proxy proxy, [Optional] CrxManifest crxManifest) + public static void AddProxyAuthenticationExtension(this T browserOption, Proxy proxy, [Optional] CrxManifest crxManifest, bool pack = true) { //easy set if there is no auth proxy //if (!proxy.HasCredential) @@ -38,7 +38,14 @@ public static void AddProxyAuthenticationExtension(this T browserOption, Prox if (browserOption is ChromeOptions chromeOptions) { - chromeOptions.AddExtension(Utilities.CreateExtension(tempFolder, crxDetailsFolder)); + if (pack) + { + chromeOptions.AddExtension(Utilities.CreateExtension(tempFolder, crxDetailsFolder)); + } + else + { + chromeOptions.AddArgument($"--load-extension={crxDetailsFolder}"); + } } } ///