stealth_browser_automation 1.1.25 → 1.1.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/browserfactory.rb +33 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f38926d28e0432ca3b7cc915917f61c4c3cb195
4
- data.tar.gz: 85bf072c269c336be834287110b33adb0a51742b
3
+ metadata.gz: 651806b3656292c2ab94d0d5881306f49ebd0e66
4
+ data.tar.gz: 70bafc7c768e14e127e76e0898f0103600507a52
5
5
  SHA512:
6
- metadata.gz: e8797630080f9de87c4e5dd0041e0410cb3d1c0c2d4df626912c961bb56edcc3dbb2e5ead9457aed27184a9d3fd564d0e4247e5bee649c26dddbc90201c193fc
7
- data.tar.gz: 9db19bed23e1798d3462bcf9608d600beaab60bb72f7918f5a7508fbee709673626eeb30b6b72f8d4dc7e5a2f0e2df04412a9d188c667f53621a134fc6520b61
6
+ metadata.gz: e423e27ee1c42b626f471afe44d56a4c976b7f8ccf22ef7fe9a9a0f72545b08bd2e5a920df0c4b048606f40f87569897ddf67815791294f345f983bf34533143
7
+ data.tar.gz: f87e94c9d404a3f329614e5a293a17d88a00e88ab5dce020b3b3fa944d84ea84f9d9e78f76af987384ebd2001c754cab0ae18b0303be743ce0528528208d7f21
@@ -566,31 +566,59 @@ module BlackStack
566
566
  end
567
567
 
568
568
  elsif @@type == BlackStack::BrowserFactory::TYPE_MIMIC
569
+ =begin
570
+ puts ''
569
571
  begin
570
- #@@browser.close if !@@browser.nil?
571
- rescue
572
+ print 'Close browser?... '
573
+ if !@@browser.nil?
574
+ puts 'yes'
575
+ print 'Close browser... '
576
+ @@browser.close
577
+ puts 'done'
578
+ else
579
+ puts 'no'
580
+ end
581
+ rescue => e
582
+ puts "error: #{e.to_s}"
572
583
  end
584
+ =end
573
585
  =begin
574
586
  begin
575
587
  # TODO: entender porque debo hacer esta llamada a start para que el perfil se cierre cuando ya estaba iniciado
576
- BlackStack::BrowserFactory.mimic(@@profile_name) if !@@profile_name.nil?
588
+ puts ''
589
+ print 'Close browser?... '
590
+ if !@@profile_name.nil?
591
+ puts 'yes'
592
+ print 'Close browser... '
593
+ BlackStack::BrowserFactory.mimic(@@profile_name)
594
+ puts 'done'
595
+ print 'Close browser (2)... '
596
+ @@browser.close
597
+ puts 'done'
598
+ else
599
+ puts 'no'
600
+ end
577
601
  rescue
578
602
  # nothing here
579
603
  end
580
604
  =end
605
+
581
606
  i = 0
582
607
  max = 3
583
608
  success = false
584
609
  while i<max && !success
585
610
  i+=1
586
- url = "http://127.0.0.1:#{BlackStack::StealthBrowserAutomation::Multilogin::mla_local_port}/api/v1/profile/stop?profileId=#{@@profile_name}"
611
+ url = "http://127.0.0.1:#{BlackStack::StealthBrowserAutomation::Multilogin::mla_local_port}/api/v1/profile/stop?profileId=#{@@profile_name}"
612
+ print "Api Call ##{i.to_s} to: #{url}... "
613
+ sleep(50000)
587
614
  uri = URI.parse(url)
588
615
  body = Net::HTTP.get(uri)
589
616
  res = JSON.parse(body)
590
617
  success = true if res['status'].to_s == 'OK'
618
+ puts "response: #{res['status'].to_s}"
591
619
  end # while i<max
592
620
  raise "Error requesting Mimic to stop (tried #{i.to_s} times)" if !success
593
-
621
+
594
622
  else
595
623
  raise 'Cannot destroy browser due unknown browser type'
596
624
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stealth_browser_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.25
4
+ version: 1.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leandro Daniel Sardi