watchdoge 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/watchdoge/version.rb +1 -1
- data/lib/watchdoge/worker.rb +25 -2
- data/watchdoge.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 323a2a000a062371819b18b2511b17a2cad737ce0cdf1a98c383bd1395df0532
|
4
|
+
data.tar.gz: ac47c7fbee5445d73bc655b7de93f56a6c57d77cd459feec9ed0412708f02af6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4917cf13e6a7fe40b332bd354e6925398b34d983aa833279b27298458472ed877a809b7e60421df5011bc60dd2030409e3822084292ebf1bdbbcbf5575a52878
|
7
|
+
data.tar.gz: 5c66ce62a0a1d6a9e53f4235eddb776f72c38bd7554427c85138f6811e3f913c5ce88a73784ea0d7269f9e830505767da8e51c7671b1999c58c73b88d066b4b7
|
data/lib/watchdoge/version.rb
CHANGED
data/lib/watchdoge/worker.rb
CHANGED
@@ -9,10 +9,12 @@ module WatchDoge
|
|
9
9
|
width: 1280,
|
10
10
|
height: 768,
|
11
11
|
headless: true,
|
12
|
-
browser: WatchDoge.configuration.browser,
|
13
12
|
http_client: @http
|
14
13
|
}.merge(opt)
|
15
|
-
|
14
|
+
|
15
|
+
default_opt.merge _browser_config
|
16
|
+
|
17
|
+
@core = WatchDoge.configuration.engine.new @browser, default_opt
|
16
18
|
|
17
19
|
# for generate uri hash
|
18
20
|
@landed_page = nil
|
@@ -86,7 +88,28 @@ module WatchDoge
|
|
86
88
|
Selenium::WebDriver::Firefox::Service.driver_path = WatchDoge.configuration.web_drivers_dir + "/geckodriver"
|
87
89
|
Selenium::WebDriver::Chrome::Service.driver_path = WatchDoge.configuration.web_drivers_dir + "/chromedriver"
|
88
90
|
@http = Selenium::WebDriver::Remote::Http::Default.new
|
91
|
+
@browser = WatchDoge.configuration.browser
|
92
|
+
end
|
93
|
+
|
94
|
+
def _browser_config
|
95
|
+
case @browser
|
96
|
+
when :chrome
|
97
|
+
prefs = {}
|
98
|
+
|
99
|
+
{
|
100
|
+
options: {
|
101
|
+
prefs: prefs
|
102
|
+
}
|
103
|
+
}
|
104
|
+
when :firefox
|
105
|
+
profile = Selenium::WebDriver::Firefox::Profile.new
|
106
|
+
profile['security.sandbox.content.level'] = 2
|
107
|
+
{
|
108
|
+
profile: profile
|
109
|
+
}
|
110
|
+
end
|
89
111
|
end
|
112
|
+
|
90
113
|
def _after_initialize
|
91
114
|
end
|
92
115
|
|
data/watchdoge.gemspec
CHANGED