puppeteer-ruby 0.40.6 → 0.40.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +7 -0
- data/docs/api_coverage.md +1 -1
- data/lib/puppeteer/browser_runner.rb +1 -1
- data/lib/puppeteer/connection.rb +1 -0
- data/lib/puppeteer/http_request.rb +15 -4
- data/lib/puppeteer/launcher/chrome.rb +1 -1
- data/lib/puppeteer/network_event_manager.rb +4 -0
- data/lib/puppeteer/network_manager.rb +1 -0
- data/lib/puppeteer/version.rb +1 -1
- data/puppeteer-ruby.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 674e5731f3d469805214a3ddb7e56ae83aaaa6850db3ccddd02002cffe4e1ca4
|
4
|
+
data.tar.gz: 47f5ad6e1a7b30c394ce950991c067c9b2dd42c144ec561eaa3dbbc9efb9b77a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f53e004dbbba48ebfaa5a1197d5bfdf9d2364a6bd84edf94d378b4b193661f0dc43de51fd61e009d91d5ca1eff7afb62e824fc23ce6bfc6dfa2b36aeda0457
|
7
|
+
data.tar.gz: 537e1dc87b4fa9d7644035e1a7a590ec32d64275ee7166940a9e6454b94997b873b1e06c1f2f8ad25c33f39caed4eb05601de46808f09748e13f9db15868c750
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
### main [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.40.
|
1
|
+
### main [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.40.7...main)]
|
2
2
|
|
3
3
|
- xxx
|
4
4
|
|
5
|
+
### 0.40.7 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.40.6...0.40.7)]
|
6
|
+
|
7
|
+
- Port Puppeteer v13.6-v13.7 features.
|
8
|
+
|
5
9
|
### 0.40.6 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.40.5...0.40.6)]
|
6
10
|
|
7
11
|
- Port Puppeteer v13.1-v13.5 features mainly for request interception.
|
data/README.md
CHANGED
@@ -229,6 +229,13 @@ end
|
|
229
229
|
|
230
230
|
https://yusukeiwaki.github.io/puppeteer-ruby-docs/
|
231
231
|
|
232
|
+
## Limitations
|
233
|
+
|
234
|
+
### Not compatible with Firefox >= v97.0
|
235
|
+
|
236
|
+
:sos: Help and contribution wanted! :sos:
|
237
|
+
https://github.com/YusukeIwaki/puppeteer-ruby/issues/220
|
238
|
+
|
232
239
|
## Contributing
|
233
240
|
|
234
241
|
Bug reports and pull requests are welcome on GitHub at https://github.com/YusukeIwaki/puppeteer-ruby.
|
data/docs/api_coverage.md
CHANGED
data/lib/puppeteer/connection.rb
CHANGED
@@ -190,7 +190,7 @@ class Puppeteer::HTTPRequest
|
|
190
190
|
# the request interception.
|
191
191
|
def finalize_interceptions
|
192
192
|
@intercept_handlers.each(&:call)
|
193
|
-
case
|
193
|
+
case intercept_resolution_state.action
|
194
194
|
when 'abort'
|
195
195
|
abort_impl(**@abort_error_reason)
|
196
196
|
when 'respond'
|
@@ -217,8 +217,14 @@ class Puppeteer::HTTPRequest
|
|
217
217
|
private def headers_to_array(headers)
|
218
218
|
return nil unless headers
|
219
219
|
|
220
|
-
headers.
|
221
|
-
|
220
|
+
headers.flat_map do |key, value|
|
221
|
+
if value.is_a?(Enumerable)
|
222
|
+
value.map do |v|
|
223
|
+
{ name: key, value: v.to_s }
|
224
|
+
end
|
225
|
+
else
|
226
|
+
{ name: key, value: value.to_s }
|
227
|
+
end
|
222
228
|
end
|
223
229
|
end
|
224
230
|
|
@@ -349,7 +355,12 @@ class Puppeteer::HTTPRequest
|
|
349
355
|
|
350
356
|
mock_response_headers = {}
|
351
357
|
headers&.each do |key, value|
|
352
|
-
mock_response_headers[key.downcase] =
|
358
|
+
mock_response_headers[key.downcase] =
|
359
|
+
if value.is_a?(Enumerable)
|
360
|
+
value.map(&:to_s)
|
361
|
+
else
|
362
|
+
value.to_s
|
363
|
+
end
|
353
364
|
end
|
354
365
|
if content_type
|
355
366
|
mock_response_headers['content-type'] = content_type
|
@@ -122,7 +122,7 @@ module Puppeteer::Launcher
|
|
122
122
|
'--disable-default-apps',
|
123
123
|
'--disable-dev-shm-usage',
|
124
124
|
'--disable-extensions',
|
125
|
-
'--disable-features=Translate',
|
125
|
+
'--disable-features=Translate,BackForwardCache',
|
126
126
|
'--disable-hang-monitor',
|
127
127
|
'--disable-ipc-flooding-protection',
|
128
128
|
'--disable-popup-blocking',
|
@@ -119,4 +119,8 @@ class Puppeteer::NetworkEventManager
|
|
119
119
|
def get_queued_event_group(network_request_id)
|
120
120
|
@queued_event_group_map[network_request_id]
|
121
121
|
end
|
122
|
+
|
123
|
+
def forget_queued_event_group(network_request_id)
|
124
|
+
@queued_event_group_map.delete(network_request_id)
|
125
|
+
end
|
122
126
|
end
|
@@ -395,6 +395,7 @@ class Puppeteer::NetworkManager
|
|
395
395
|
# We may have skipped response and loading events because we didn't have
|
396
396
|
# this ExtraInfo event yet. If so, emit those events now.
|
397
397
|
if_present(@network_event_manager.get_queued_event_group(event['requestId'])) do |queued_events|
|
398
|
+
@network_event_manager.forget_queued_event_group(event['requestId'])
|
398
399
|
emit_response_event(queued_events.response_received_event, event)
|
399
400
|
if_present(queued_events.loading_finished_event) do |loading_finished_event|
|
400
401
|
emit_loading_finished(loading_finished_event)
|
data/lib/puppeteer/version.rb
CHANGED
data/puppeteer-ruby.gemspec
CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_development_dependency 'rollbar'
|
33
33
|
spec.add_development_dependency 'rspec', '~> 3.11.0'
|
34
34
|
spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
|
35
|
-
spec.add_development_dependency 'rubocop', '~> 1.
|
35
|
+
spec.add_development_dependency 'rubocop', '~> 1.29.0'
|
36
36
|
spec.add_development_dependency 'rubocop-rspec'
|
37
37
|
spec.add_development_dependency 'sinatra'
|
38
38
|
spec.add_development_dependency 'webrick'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppeteer-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.40.
|
4
|
+
version: 0.40.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YusukeIwaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -170,14 +170,14 @@ dependencies:
|
|
170
170
|
requirements:
|
171
171
|
- - "~>"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
173
|
+
version: 1.29.0
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 1.
|
180
|
+
version: 1.29.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rubocop-rspec
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|