puppeteer-ruby 0.45.4 → 0.45.6

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: 7b1350bb0664f3895805d6b49f56c7aa6543b7fd56d082843ebc1e651e2d7cdb
4
- data.tar.gz: 711975924a31fcd49896ca7e9642a6b875087b6fc7535361af353c27ccc2e845
3
+ metadata.gz: ba80a8570a4df72a141dff37a81899373827c461a5327311cc28cae8fc5be16f
4
+ data.tar.gz: 7811d540f215426009b28906723ee03c93eb0504ccbfacd321d1c219be5105a1
5
5
  SHA512:
6
- metadata.gz: 0a744ac42773e63ceca23f5a61e26739e2e57a44bd1e6d842c927ba33b3af922d40496c3eaf742d2dcffd79fa7bd621f2cd13223e069c2f7a9e70eb8dd435898
7
- data.tar.gz: a08bed4a63fdfeaf4c3d9a4ce959fa4340ca0948c08497c1855ccad4b871f9986727ad084f23aafaca0fea120ba21b44af06265a990d1d113f0284aea8a1dfc9
6
+ metadata.gz: f047d5dea4f9e7dc34c6578fa22887ef147be87f123f47c16d5b684ae9ac34cf6d2f3797f6d2513b039cf872bf02ff49d3e0505af7cfae98f5fa11df133f6315
7
+ data.tar.gz: 580d0082d1e2bb05615d5eb472b5df5dff060c291bffd11a2ce08c16ca6592451f071f2b5192ab156141aa65c21d03071eb0af17162395b548dca7a056ab1fff
data/CHANGELOG.md CHANGED
@@ -1,7 +1,19 @@
1
- ### main [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.45.4...main)]
1
+ ### main [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.45.6...main)]
2
2
 
3
3
  - xxx
4
4
 
5
+ ### 0.45.6 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.45.5...0.45.6)]
6
+
7
+ Bugfix:
8
+
9
+ - Fix puppeteer-ruby to work with Firefox >= 129. Note that CDP support for Firefox is already ended. [ref](https://fxdx.dev/deprecating-cdp-support-in-firefox-embracing-the-future-with-webdriver-bidi/)
10
+
11
+ ### 0.45.5 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.45.4...0.45.5)]
12
+
13
+ Bugfix:
14
+
15
+ - Relax concurrent-ruby's dependency for Rails 7.2 compatibility. ([#333](https://github.com/YusukeIwaki/puppeteer-ruby/pull/333))
16
+
5
17
  ### 0.45.4 [[diff](https://github.com/YusukeIwaki/puppeteer-ruby/compare/0.45.3...0.45.4)]
6
18
 
7
19
  Bugfix
data/README.md CHANGED
@@ -44,19 +44,19 @@ require 'puppeteer-ruby'
44
44
  Puppeteer.launch(headless: false, slow_mo: 50, args: ['--window-size=1280,800']) do |browser|
45
45
  page = browser.new_page
46
46
  page.viewport = Puppeteer::Viewport.new(width: 1280, height: 800)
47
- page.goto("https://github.com/", wait_until: 'domcontentloaded')
47
+ with_network_retry { page.goto("https://github.com/", wait_until: 'domcontentloaded') }
48
48
 
49
- form = page.query_selector("form.js-site-search-form")
50
- search_input = form.query_selector("input.header-search-input")
49
+ page.wait_for_selector('[placeholder="Search or jump to..."]').click
50
+ search_input = page.wait_for_selector('input[name="query-builder-test"]')
51
51
  search_input.click
52
52
  page.keyboard.type_text("puppeteer")
53
53
 
54
54
  page.wait_for_navigation do
55
- search_input.press('Enter')
55
+ search_input.press("Enter")
56
56
  end
57
57
 
58
- list = page.query_selector("ul.repo-list")
59
- items = list.query_selector_all("div.f4")
58
+ list = page.wait_for_selector('[data-testid="results-list"]')
59
+ items = list.query_selector_all(".search-title")
60
60
  items.each do |item|
61
61
  title = item.eval_on_selector("a", "a => a.innerText")
62
62
  puts("==> #{title}")
@@ -95,16 +95,16 @@ More usage examples can be found [here](https://github.com/YusukeIwaki/puppeteer
95
95
 
96
96
  Following packages are required.
97
97
 
98
- * Google Chrome or Chromium
99
- * In Debian-based images, `google-chrome-stable`
100
- * In Alpine-based images, `chromium`
98
+ - Google Chrome or Chromium
99
+ - In Debian-based images, `google-chrome-stable`
100
+ - In Alpine-based images, `chromium`
101
101
 
102
102
  Also, CJK font will be required for Chinese, Japanese, Korean sites.
103
103
 
104
104
  ### References
105
105
 
106
- * Puppeteer official README: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker
107
- * puppeteer-ruby example: https://github.com/YusukeIwaki/puppeteer-ruby-example/tree/master/docker_chromium
106
+ - Puppeteer official README: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker
107
+ - puppeteer-ruby example: https://github.com/YusukeIwaki/puppeteer-ruby-example/tree/master/docker_chromium
108
108
 
109
109
  ## :bulb: Collaboration with Selenium or Capybara
110
110
 
@@ -224,12 +224,10 @@ RSpec.describe 'Sample integration tests', driver: :null do
224
224
  end
225
225
  ```
226
226
 
227
-
228
227
  ## API
229
228
 
230
229
  https://yusukeiwaki.github.io/puppeteer-ruby-docs/
231
230
 
232
-
233
231
  ## Contributing
234
232
 
235
233
  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: v19.5.0
3
- - puppeteer-ruby version: 0.45.4
3
+ - puppeteer-ruby version: 0.45.6
4
4
 
5
5
  ## Puppeteer
6
6
 
@@ -178,6 +178,10 @@ class Puppeteer::BrowserRunner
178
178
  Timeout.timeout(timeout / 1000.0) do
179
179
  loop do
180
180
  line = browser_process.stderr.readline
181
+ /^WebDriver BiDi listening on (ws:\/\/.*)$/.match(line) do |m|
182
+ raise NotImplementedError.new('WebDriver BiDi support is not yet implemented')
183
+ end
184
+
181
185
  /^DevTools listening on (ws:\/\/.*)$/.match(line) do |m|
182
186
  return m[1].gsub(/\r/, '')
183
187
  end
@@ -187,8 +187,10 @@ class Puppeteer::Connection
187
187
  NON_DEBUG_PRINT_METHODS = [
188
188
  'Network.dataReceived',
189
189
  'Network.loadingFinished',
190
+ 'Network.requestServedFromCache',
190
191
  'Network.requestWillBeSent',
191
192
  'Network.requestWillBeSentExtraInfo',
193
+ 'Network.resourceChangedPriority',
192
194
  'Network.responseReceived',
193
195
  'Network.responseReceivedExtraInfo',
194
196
  'Page.lifecycleEvent',
@@ -122,7 +122,11 @@ module Puppeteer::Launcher
122
122
 
123
123
  FIREFOX_EXECUTABLE_PATHS = {
124
124
  windows: "#{ENV['PROGRAMFILES']}\\Firefox Nightly\\firefox.exe",
125
- darwin: '/Applications/Firefox Nightly.app/Contents/MacOS/firefox',
125
+ darwin: -> {
126
+ ['Firefox Nightly.app', 'Firefox Developer Edition.app'].map do |app|
127
+ "/Applications/#{app}/Contents/MacOS/firefox"
128
+ end.find { |path| File.exist?(path) }
129
+ },
126
130
  linux: -> { Puppeteer::ExecutablePathFinder.new('firefox').find_first },
127
131
  }.freeze
128
132
 
@@ -161,7 +165,7 @@ module Puppeteer::Launcher
161
165
 
162
166
  # @param options [Launcher::ChromeArgOptions]
163
167
  def initialize(chrome_arg_options)
164
- firefox_arguments = ['--no-remote']
168
+ firefox_arguments = []
165
169
 
166
170
  if Puppeteer.env.darwin?
167
171
  firefox_arguments << '--foreground'
@@ -236,7 +240,6 @@ module Puppeteer::Launcher
236
240
  'browser.safebrowsing.blockedURIs.enabled': false,
237
241
  'browser.safebrowsing.downloads.enabled': false,
238
242
  'browser.safebrowsing.malware.enabled': false,
239
- 'browser.safebrowsing.passwords.enabled': false,
240
243
  'browser.safebrowsing.phishing.enabled': false,
241
244
 
242
245
  # Disable updates to search engines.
@@ -262,6 +265,9 @@ module Puppeteer::Launcher
262
265
  # Do not warn when multiple tabs will be opened
263
266
  'browser.tabs.warnOnOpen': false,
264
267
 
268
+ # Do not automatically offer translations, as tests do not expect this.
269
+ 'browser.translations.automaticallyPopup': false,
270
+
265
271
  # Disable the UI tour.
266
272
  'browser.uitour.enabled': false,
267
273
  # Turn off search suggestions in the location bar so as not to trigger
@@ -324,30 +330,33 @@ module Puppeteer::Launcher
324
330
  # Make sure opening about:addons will not hit the network
325
331
  'extensions.webservice.discoverURL': "http://#{server}/dummy/discoveryURL",
326
332
 
327
- # Temporarily force disable BFCache in parent (https://bit.ly/bug-1732263)
328
- 'fission.bfcacheInParent': false,
329
- # Force all web content to use a single content process
330
- 'fission.webContentIsolationStrategy': 0,
331
-
332
333
  # Allow the application to have focus even it runs in the background
333
334
  'focusmanager.testmode': true,
335
+
334
336
  # Disable useragent updates
335
337
  'general.useragent.updates.enabled': false,
338
+
336
339
  # Always use network provider for geolocation tests so we bypass the
337
340
  # macOS dialog raised by the corelocation provider
338
341
  'geo.provider.testing': true,
342
+
339
343
  # Do not scan Wifi
340
344
  'geo.wifi.scan': false,
345
+
341
346
  # No hang monitor
342
347
  'hangmonitor.timeout': 0,
348
+
343
349
  # Show chrome errors and warnings in the error console
344
350
  'javascript.options.showInConsole': true,
345
351
 
346
352
  # Disable download and usage of OpenH264: and Widevine plugins
347
353
  'media.gmp-manager.updateEnabled': false,
348
- # Prevent various error message on the console
349
- # jest-puppeteer asserts that no error message is emitted by the console
350
- 'network.cookie.cookieBehavior': 0,
354
+
355
+ # Disable the GFX sanity window
356
+ 'media.sanity-test.disabled': true,
357
+
358
+ # Disable experimental feature that is only available in Nightly
359
+ 'network.cookie.sameSite.laxByDefault': false,
351
360
 
352
361
  # Do not prompt for temporary redirects
353
362
  'network.http.prompt-temp-redirect': false,
@@ -367,15 +376,17 @@ module Puppeteer::Launcher
367
376
 
368
377
  'privacy.trackingprotection.enabled': false,
369
378
 
370
- # Enable Remote Agent
371
- # https://bugzilla.mozilla.org/show_bug.cgi?id=1544393
379
+ # Can be removed once Firefox 89 is no longer supported
380
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1710839
372
381
  'remote.enabled': true,
373
382
 
374
383
  # Don't do network connections for mitm priming
375
384
  'security.certerrors.mitm.priming.enabled': false,
385
+
376
386
  # Local documents have access to all other local documents,
377
387
  # including directory listings
378
388
  'security.fileuri.strict_origin_policy': false,
389
+
379
390
  # Do not wait for the notification button security delay
380
391
  'security.notification_enable_delay': 0,
381
392
 
@@ -385,6 +396,7 @@ module Puppeteer::Launcher
385
396
  # Do not automatically fill sign-in forms with known usernames and
386
397
  # passwords
387
398
  'signon.autofillForms': false,
399
+
388
400
  # Disable password capture, so that tests that include forms are not
389
401
  # influenced by the presence of the persistent doorhanger notification
390
402
  'signon.rememberSignons': false,
@@ -400,7 +412,24 @@ module Puppeteer::Launcher
400
412
 
401
413
  # Prevent starting into safe mode after application crashes
402
414
  'toolkit.startup.max_resumed_crashes': -1,
403
- }
415
+ }.merge({ # https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.2.2/packages/puppeteer-core/src/node/FirefoxLauncher.ts#L45-L53
416
+ # Do not close the window when the last tab gets closed
417
+ 'browser.tabs.closeWindowWithLastTab': false,
418
+ # Prevent various error message on the console
419
+ # jest-puppeteer asserts that no error message is emitted by the console
420
+ 'network.cookie.cookieBehavior': 0,
421
+ # Temporarily force disable BFCache in parent (https://bit.ly/bug-1732263)
422
+ 'fission.bfcacheInParent': false,
423
+ # Only enable the CDP protocol
424
+ 'remote.active-protocols': 2,
425
+ }).merge({ # https://github.com/puppeteer/puppeteer/blob/puppeteer-v23.2.2/packages/puppeteer-core/src/node/FirefoxLauncher.ts#L55-L60
426
+ # Force all web content to use a single content process. TODO: remove
427
+ # this once Firefox supports mouse event dispatch from the main frame
428
+ # context. Once this happens, webContentIsolationStrategy should only
429
+ # be set for CDP. See
430
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1773393
431
+ 'fission.webContentIsolationStrategy': 0,
432
+ })
404
433
 
405
434
  default_preferences.merge(extra_prefs)
406
435
  end
@@ -1,3 +1,3 @@
1
1
  module Puppeteer
2
- VERSION = '0.45.4'
2
+ VERSION = '0.45.6'
3
3
  end
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = ['lib']
22
22
 
23
23
  spec.required_ruby_version = '>= 2.6'
24
- spec.add_dependency 'concurrent-ruby', '>= 1.1', '< 1.3'
24
+ spec.add_dependency 'concurrent-ruby', '>= 1.1', '< 1.4'
25
25
  spec.add_dependency 'websocket-driver', '>= 0.6.0'
26
26
  spec.add_dependency 'mime-types', '>= 3.0'
27
27
  spec.add_development_dependency 'bundler'
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'rspec_junit_formatter' # for CircleCI.
35
35
  spec.add_development_dependency 'rubocop', '~> 1.50.0'
36
36
  spec.add_development_dependency 'rubocop-rspec'
37
- spec.add_development_dependency 'sinatra'
37
+ spec.add_development_dependency 'sinatra', '< 4.0.0'
38
38
  spec.add_development_dependency 'webrick'
39
39
  spec.add_development_dependency 'yard'
40
40
  end
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.45.4
4
+ version: 0.45.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - YusukeIwaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-05 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '1.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '1.3'
22
+ version: '1.4'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '1.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '1.3'
32
+ version: '1.4'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: websocket-driver
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -202,16 +202,16 @@ dependencies:
202
202
  name: sinatra
203
203
  requirement: !ruby/object:Gem::Requirement
204
204
  requirements:
205
- - - ">="
205
+ - - "<"
206
206
  - !ruby/object:Gem::Version
207
- version: '0'
207
+ version: 4.0.0
208
208
  type: :development
209
209
  prerelease: false
210
210
  version_requirements: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - ">="
212
+ - - "<"
213
213
  - !ruby/object:Gem::Version
214
- version: '0'
214
+ version: 4.0.0
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: webrick
217
217
  requirement: !ruby/object:Gem::Requirement
@@ -356,7 +356,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
356
356
  - !ruby/object:Gem::Version
357
357
  version: '0'
358
358
  requirements: []
359
- rubygems_version: 3.5.3
359
+ rubygems_version: 3.5.16
360
360
  signing_key:
361
361
  specification_version: 4
362
362
  summary: A ruby port of puppeteer