puppeteer-ruby 0.37.0 → 0.37.1

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: 9e46056e6227e597554a407d47c132610af952d42b1cd7c2149e2046e0d8f1bb
4
- data.tar.gz: 99a5c6fd6885181e32c72086a768c60583738974a3c86a05a693af2b97b51bc3
3
+ metadata.gz: 56a2cd3d9440bce6f77f2a072e8c8e7ea83fdd3d65a7e85e1887f7f7dd4481ce
4
+ data.tar.gz: 337c5cd7e4c23bd5e3c154bbaaae229d4285c8ba491ca427197ee7449c1f1849
5
5
  SHA512:
6
- metadata.gz: d4b1032b52bb5a0ad92e57f0bac5fe5208b785679f1d7efff0ab335cb28478f6110979102d0ec4759ef2f86654b4d231e018aa9cdb3982dc1ffa2e985fa4c55f
7
- data.tar.gz: 42f81fe580fcb85b5c57397962362c3c6b0ba7462fe210c65ee017b9e73c0a3d9d091c03a7b18f6e6d78f3a3c52572a5d0bb8284f1087412344a184e8624170d
6
+ metadata.gz: '005883b864a160d29a8879a8d54945edbce02f6d1b80a0f8816d84244b46c62d11417e2bcf2bc67e8b7f7a4486dc201ecb2961070fe875fc948be0483be8bcee'
7
+ data.tar.gz: 1a7cd9d0c2aacde091d0f6d0738c61e4a28a96830f2b65dae8e6e84fd3c190ea69bf8e964748d61020f264bfcbc25901e4e1895289b1a98a7d5452c03e2647de
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
- ### master [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.37.0...master)]
1
+ ### master [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.37.1...master)]
2
2
 
3
3
  - xxx
4
4
 
5
+ ### 0.37.1 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.37.0...0.37.1)]
6
+
7
+ Bugfix:
8
+
9
+ - Fix handle_SIGINT, handle_SIGTERM, handle_SIGHUP options to work with `false` value specified.
10
+
5
11
  ### 0.37.0 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.36.0...0.37.0)]
6
12
 
7
13
  New features:
data/docs/api_coverage.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # API coverages
2
2
  - Puppeteer version: v10.4.0
3
- - puppeteer-ruby version: 0.37.0
3
+ - puppeteer-ruby version: 0.37.1
4
4
 
5
5
  ## Puppeteer
6
6
 
@@ -94,7 +94,7 @@ class Puppeteer::BrowserRunner
94
94
  FileUtils.rm_rf(@temp_directory)
95
95
  end
96
96
  }
97
- trap(:EXIT) do
97
+ at_exit do
98
98
  kill
99
99
  end
100
100
 
@@ -35,9 +35,9 @@ module Puppeteer::Launcher
35
35
  @channel = options[:channel]
36
36
  @executable_path = options[:executable_path]
37
37
  @ignore_default_args = options[:ignore_default_args] || false
38
- @handle_SIGINT = options[:handle_SIGINT] || true
39
- @handle_SIGTERM = options[:handle_SIGTERM] || true
40
- @handle_SIGHUP = options[:handle_SIGHUP] || true
38
+ @handle_SIGINT = options.fetch(:handle_SIGINT, true)
39
+ @handle_SIGTERM = options.fetch(:handle_SIGTERM, true)
40
+ @handle_SIGHUP = options.fetch(:handle_SIGHUP, true)
41
41
  @timeout = options[:timeout] || 30000
42
42
  @dumpio = options[:dumpio] || false
43
43
  @env = options[:env] || ENV
@@ -142,9 +142,14 @@ class Puppeteer::NetworkManager
142
142
  end
143
143
 
144
144
  # @param user_agent [String]
145
- def user_agent=(user_agent)
146
- @client.send_message('Network.setUserAgentOverride', userAgent: user_agent)
145
+ # @param user_agent_metadata [Hash]
146
+ def set_user_agent(user_agent, user_agent_metadata = nil)
147
+ @client.send_message('Network.setUserAgentOverride', {
148
+ userAgent: user_agent,
149
+ userAgentMetadata: user_agent_metadata,
150
+ }.compact)
147
151
  end
152
+ alias_method :user_agent=, :set_user_agent
148
153
 
149
154
  def cache_enabled=(enabled)
150
155
  @user_cache_disabled = !enabled
@@ -461,37 +461,6 @@ class Puppeteer::Page
461
461
 
462
462
  nil
463
463
  end
464
- # /**
465
- # * @param {string} name
466
- # * @param {Function} puppeteerFunction
467
- # */
468
- # async exposeFunction(name, puppeteerFunction) {
469
- # if (this._pageBindings.has(name))
470
- # throw new Error(`Failed to add page binding with name ${name}: window['${name}'] already exists!`);
471
- # this._pageBindings.set(name, puppeteerFunction);
472
-
473
- # const expression = helper.evaluationString(addPageBinding, name);
474
- # await this._client.send('Runtime.addBinding', {name: name});
475
- # await this._client.send('Page.addScriptToEvaluateOnNewDocument', {source: expression});
476
- # await Promise.all(this.frames().map(frame => frame.evaluate(expression).catch(debugError)));
477
-
478
- # function addPageBinding(bindingName) {
479
- # const binding = window[bindingName];
480
- # window[bindingName] = (...args) => {
481
- # const me = window[bindingName];
482
- # let callbacks = me['callbacks'];
483
- # if (!callbacks) {
484
- # callbacks = new Map();
485
- # me['callbacks'] = callbacks;
486
- # }
487
- # const seq = (me['lastSeq'] || 0) + 1;
488
- # me['lastSeq'] = seq;
489
- # const promise = new Promise((resolve, reject) => callbacks.set(seq, {resolve, reject}));
490
- # binding(JSON.stringify({name: bindingName, seq, args}));
491
- # return promise;
492
- # };
493
- # }
494
- # }
495
464
 
496
465
  # @param username [String?]
497
466
  # @param password [String?]
@@ -505,9 +474,11 @@ class Puppeteer::Page
505
474
  end
506
475
 
507
476
  # @param user_agent [String]
508
- def user_agent=(user_agent)
509
- @frame_manager.network_manager.user_agent = user_agent
477
+ # @param user_agent_metadata [Hash]
478
+ def set_user_agent(user_agent, user_agent_metadata = nil)
479
+ @frame_manager.network_manager.set_user_agent(user_agent, user_agent_metadata)
510
480
  end
481
+ alias_method :user_agent=, :set_user_agent
511
482
 
512
483
  def metrics
513
484
  response = @client.send_message('Performance.getMetrics')
@@ -1,3 +1,3 @@
1
1
  module Puppeteer
2
- VERSION = '0.37.0'
2
+ VERSION = '0.37.1'
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.10.0 '
34
34
  spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
35
- spec.add_development_dependency 'rubocop', '~> 1.21.0'
35
+ spec.add_development_dependency 'rubocop', '~> 1.22.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.37.0
4
+ version: 0.37.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2021-10-26 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.21.0
173
+ version: 1.22.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.21.0
180
+ version: 1.22.0
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: rubocop-rspec
183
183
  requirement: !ruby/object:Gem::Requirement