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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51b26b6b3710f06e7a7cfb7e9f5730bbb9517396fd30a7f271161820bb6902c6
4
- data.tar.gz: 528fd6520a029cf9d85424a105cf19a156f428435dc795a8b8753c8cbfa442db
3
+ metadata.gz: 674e5731f3d469805214a3ddb7e56ae83aaaa6850db3ccddd02002cffe4e1ca4
4
+ data.tar.gz: 47f5ad6e1a7b30c394ce950991c067c9b2dd42c144ec561eaa3dbbc9efb9b77a
5
5
  SHA512:
6
- metadata.gz: ad616ae1574e76f71cb7e7cb1dae5cba4ae4ad65865ab6a5e6cb92c6033b9ce654de2b364b5d5351e69302f88fc48231c2a9bd97765af9ed827862e762f9d748
7
- data.tar.gz: 9a194d8df09c6c6eda97ef095d67dafd693b7ff386e612d926925bdbcf41b3b2a21c06862eff90525e39f85c7d8a5ded419bb8c4b4a3ecb33413c7ccdf47215e
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.6...main)]
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
@@ -1,6 +1,6 @@
1
1
  # API coverages
2
2
  - Puppeteer version: v13.5.2
3
- - puppeteer-ruby version: 0.40.6
3
+ - puppeteer-ruby version: 0.40.7
4
4
 
5
5
  ## Puppeteer
6
6
 
@@ -128,7 +128,7 @@ class Puppeteer::BrowserRunner
128
128
  def close
129
129
  return if @closed
130
130
 
131
- if @using_temp_user_data_dir && !@for_firefox
131
+ if @using_temp_user_data_dir
132
132
  kill
133
133
  elsif @connection
134
134
  begin
@@ -191,6 +191,7 @@ class Puppeteer::Connection
191
191
  'Network.responseReceived',
192
192
  'Network.responseReceivedExtraInfo',
193
193
  'Page.lifecycleEvent',
194
+ 'Target.receivedMessageFromTarget', # only Firefox
194
195
  ]
195
196
 
196
197
  def handle_message(message)
@@ -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 @intercept_resolution.action
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.map do |key, value|
221
- { name: key, value: value.to_s }
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] = value
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)
@@ -1,3 +1,3 @@
1
1
  module Puppeteer
2
- VERSION = '0.40.6'
2
+ VERSION = '0.40.7'
3
3
  end
@@ -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.27.0'
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.6
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-04-21 00:00:00.000000000 Z
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.27.0
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.27.0
180
+ version: 1.29.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rubocop-rspec
183
183
  requirement: !ruby/object:Gem::Requirement