title: Selenium firefox opens 2 firefox (With CDI)
body: <p>I'm using selenium with CDI to create it, every time i use it, selenium opens 2 firefox and just use one, leaving the other one open.</p>
  
  <p>I'm creating the FirefoxDriver with CDI so i can inject and use it on various places.
  They way i'm creating:</p>
  
  <pre><code>@ApplicationScoped
  public class FirefoxDriverProducer {
  
      @RequestScoped
      @Produces 
      public FirefoxDriver getDriver() {
          String caminhoFirefox = "/usr/bin/firefox";
          String profileFirefox = "selenium";
  
          File pathToBinary = new File(caminhoFirefox);
          FirefoxBinary ffBinary = new FirefoxBinary(pathToBinary);
  
          ProfilesIni profile = new ProfilesIni();
          FirefoxProfile myprofile = profile.getProfile(profileFirefox);
  
          return new FirefoxDriver(ffBinary, myprofile);
      }
  
      public void close(@Disposes FirefoxDriver driver) {
          driver.quit();
      }
  
  }
  </code></pre>
  
  <p>To use it, i'm just doing like this:</p>
  
  <pre><code>@ApplicationScoped
  public class Crawler {
  
      @Inject
      private FirefoxDriver driver;
  
      public void Crawl(){
          driver.get("http://siteimcrawling.com");
      }
  }
  </code></pre>
  
  <p>Why is it opening 2 Firefox instead of one?</p>