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 +4 -4
- data/CHANGELOG.md +7 -1
- data/docs/api_coverage.md +1 -1
- data/lib/puppeteer/browser_runner.rb +1 -1
- data/lib/puppeteer/launcher/launch_options.rb +3 -3
- data/lib/puppeteer/network_manager.rb +7 -2
- data/lib/puppeteer/page.rb +4 -33
- 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: 56a2cd3d9440bce6f77f2a072e8c8e7ea83fdd3d65a7e85e1887f7f7dd4481ce
|
4
|
+
data.tar.gz: 337c5cd7e4c23bd5e3c154bbaaae229d4285c8ba491ca427197ee7449c1f1849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
@@ -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
|
39
|
-
@handle_SIGTERM = options
|
40
|
-
@handle_SIGHUP = options
|
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
|
-
|
146
|
-
|
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
|
data/lib/puppeteer/page.rb
CHANGED
@@ -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
|
-
|
509
|
-
|
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')
|
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.10.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.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.
|
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-
|
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.
|
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.
|
180
|
+
version: 1.22.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: rubocop-rspec
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|