Giter Site home page Giter Site logo

selenium-proxy-authentication.firefox's Introduction

Selenium Proxy Authentication For Firefox

Easily add your auth proxies to your Firefox (Gecko) Driver with one line of code With Extension

Installation

You Can Simply Add this Library to your project with Nuget Package:

Install-Package SeleniumProxyAuthentication.Firefox -Version 1.0.0

! You need to download the "Nightly" or "Developer Edition" of firefox to use this library because in the original browser extensions should be verified before installing since version 43

How to Use it

  • First you need to download the gecko driver from here (make sure that the version of your firefox browser should be match with the version of gecko driver that you download!)
https://github.com/mozilla/geckodriver/releases
  • Then put the geckodriver.exe in your project bin directory

  • Create a new Instance of FirefoxOptions and define the FirefoxProfile (if path of profile not set it will generate the profile randomly)

private static readonly FirefoxOptions FirefoxOptions = new() {Profile = new FirefoxProfile()};
  • Pass the FirefoxOptions Instance to a new Instance of FirefoxDriver
IWebDriver driver = new FirefoxDriver(FirefoxOptions);
  • Attach your proxy to the instance of firefox driver using extension method "AddProxyAuthenticationExtension"
driver.AddProxyAuthenticationExtension(new SeleniumProxyAuthentication.Proxy(
                    ProxyProtocols.HTTP,
                    "host:port:username:password"
                    ));

driver.Navigate().GoToUrl(new Uri("https://github.com/"));
Thread.Sleep(5000);
driver.Quit();
  • Remove Entire Cache That Created By Extensions using this method
driver.DeleteExtensionsCache();

Guides

Proxy Format

  • Support all kind of proxy types (i tested http/s, socks5)
  • Host:Port:Username:Password
  • Host:Port

Licence

License

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.