Sfoglia il codice sorgente

Use Driver's ua in demolish to automatically any proxies/etc

Daniel Gempesaw 10 anni fa
parent
commit
402841eacd
2 ha cambiato i file con 2 aggiunte e 4 eliminazioni
  1. 1 2
      lib/Selenium/Chrome.pm
  2. 1 2
      lib/Selenium/PhantomJS.pm

+ 1 - 2
lib/Selenium/Chrome.pm

@@ -61,9 +61,8 @@ sub DEMOLISH {
     my ($self) = @_;
 
     if ($self->binary_mode) {
-
         my $port = $self->port;
-        my $ua = LWP::UserAgent->new;
+        my $ua = $self->ua;
 
         $ua->get('127.0.0.1:' . $port . '/wd/hub/shutdown');
     }

+ 1 - 2
lib/Selenium/PhantomJS.pm

@@ -62,9 +62,8 @@ sub DEMOLISH {
     my ($self) = @_;
 
     if ($self->binary_mode) {
-
         my $port = $self->port;
-        my $ua = LWP::UserAgent->new;
+        my $ua = $self->ua;
 
         $ua->get('127.0.0.1:' . $port . '/wd/hub/shutdown');
     }