capybara-lightpanda 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +1 -1
- data/lib/capybara/lightpanda/browser/console.rb +17 -4
- data/lib/capybara/lightpanda/browser/navigation.rb +14 -16
- data/lib/capybara/lightpanda/browser/runtime.rb +79 -13
- data/lib/capybara/lightpanda/browser/selenium_compat.rb +3 -2
- data/lib/capybara/lightpanda/browser.rb +63 -4
- data/lib/capybara/lightpanda/client/web_socket.rb +44 -21
- data/lib/capybara/lightpanda/client.rb +25 -6
- data/lib/capybara/lightpanda/cookies.rb +45 -5
- data/lib/capybara/lightpanda/driver.rb +16 -7
- data/lib/capybara/lightpanda/javascripts/attach.js +1 -0
- data/lib/capybara/lightpanda/javascripts/predicates.js +41 -2
- data/lib/capybara/lightpanda/keyboard.rb +23 -5
- data/lib/capybara/lightpanda/network.rb +31 -4
- data/lib/capybara/lightpanda/node.rb +102 -28
- data/lib/capybara/lightpanda/options.rb +6 -7
- data/lib/capybara/lightpanda/process.rb +64 -29
- data/lib/capybara/lightpanda/version.rb +1 -1
- metadata +2 -2
|
@@ -63,10 +63,10 @@ module Capybara
|
|
|
63
63
|
# returns spec-correct booleans. Lets _lightpanda.isVisible detect
|
|
64
64
|
# inline-@media-gated hides via el.checkVisibility() without any
|
|
65
65
|
# gem-side workaround),
|
|
66
|
-
# PR #2487 (css: external <link rel="stylesheet"> fetch behind
|
|
67
|
-
#
|
|
68
|
-
#
|
|
69
|
-
#
|
|
66
|
+
# PR #2487 (css: external <link rel="stylesheet"> fetch behind a CLI
|
|
67
|
+
# flag — build_args passes it unconditionally, so the floor MUST include
|
|
68
|
+
# the build that introduced it; since #3305 (8946) the spelling is
|
|
69
|
+
# `--load-resources stylesheet`, see the 2026-09-06 bump),
|
|
70
70
|
# PR #2498 (StyleManager: author display rule beats UA [hidden] — fixes
|
|
71
71
|
# the Stimulus/Alpine dropdown ElementNotFound),
|
|
72
72
|
# PR #2635 (dom: DOM.setFileInputFiles backs input.files + fires change
|
|
@@ -227,11 +227,44 @@ module Capybara
|
|
|
227
227
|
# and `localhost.evil.com:<port>` still 403). Below 8875 only an IP
|
|
228
228
|
# literal passed, so a user-supplied `ws_url:` had to say 127.0.0.1.
|
|
229
229
|
# Pinned by test/features/ws_url_host_test.rb.
|
|
230
|
-
# Build 8875 = the #3256 merge (f2169836e).
|
|
231
|
-
#
|
|
232
|
-
#
|
|
233
|
-
#
|
|
234
|
-
|
|
230
|
+
# Build 8875 = the #3256 merge (f2169836e).
|
|
231
|
+
#
|
|
232
|
+
# 2026-09-06 bump 8875 -> 9058. The binding constraint is the lockstep
|
|
233
|
+
# with MINIMUM_RELEASE below: 9058 is exactly `git rev-list --count
|
|
234
|
+
# 0.4.0`, the newest tagged release, so this is as high as the nightly
|
|
235
|
+
# floor can go without naming a release that does not exist. Two fixes
|
|
236
|
+
# the gem now asserts on ride along:
|
|
237
|
+
# #3298 (8937) Backspace/Delete through CDP Input.dispatchKeyEvent
|
|
238
|
+
# actually edit an <input>/<textarea>: a trusted `beforeinput`
|
|
239
|
+
# (cancelable) then `input` with inputType deleteContentBackward /
|
|
240
|
+
# deleteContentForward, via the text_entry.zig mixin. Below 8937 the
|
|
241
|
+
# keys were dead, so Node#send_keys(:backspace) silently did nothing.
|
|
242
|
+
# Pinned by test/features/keyboard_editing_test.rb.
|
|
243
|
+
# #3305 (8946) renamed --enable-external-stylesheets to
|
|
244
|
+
# `--load-resources stylesheet` and --log-filter-scopes to
|
|
245
|
+
# --log-filter; build_args now passes the new spelling, which is a
|
|
246
|
+
# fatal UnknownOption below 8946. (The same PR flipped iframes and
|
|
247
|
+
# workers off by default — Browser#configure_loading re-enables them
|
|
248
|
+
# per BrowserContext, and did so before this bump.)
|
|
249
|
+
#
|
|
250
|
+
# 2026-10-03 bump 9058 -> 9994 (= release 1.0.0, the new lockstep cap).
|
|
251
|
+
# Retired or ungated by it:
|
|
252
|
+
# #3375 (9071) option.selected deselects its siblings — SELECT_OPTION_JS
|
|
253
|
+
# dropped its `sel.value =` detour, which selected the FIRST option
|
|
254
|
+
# sharing a value rather than the one Capybara resolved.
|
|
255
|
+
# #3378 (9207) matchMedia `change` fires on a viewport override —
|
|
256
|
+
# viewport_test.rb's pin runs un-gated.
|
|
257
|
+
# #3414 / #3420 / #3422 / #3424 (9217-9234, ours) trusted
|
|
258
|
+
# `beforeinput` is cancelable; `.value =` moves the caret to the end;
|
|
259
|
+
# a child-text <textarea> can be selected; arrows/Home/End move the
|
|
260
|
+
# caret — the `send_keys should send special characters` skip is
|
|
261
|
+
# gone and keyboard_editing_test.rb pins all four.
|
|
262
|
+
# Behavior changes the floor now guarantees, all compensated or
|
|
263
|
+
# Chrome-parity: #3654 (9883) CORS enforced by default (blocked requests
|
|
264
|
+
# end in Network.loadingFailed, which Network consumes); #3529 (9877)
|
|
265
|
+
# SameSite=None without Secure refused (Cookies#set reports it);
|
|
266
|
+
# #3702 (9968) click no longer focuses (CLICK_JS focuses itself).
|
|
267
|
+
MINIMUM_NIGHTLY_BUILD = Gem::Version.new("9994")
|
|
235
268
|
|
|
236
269
|
# Second, equivalent floor for the *release* channel.
|
|
237
270
|
#
|
|
@@ -240,21 +273,16 @@ module Capybara
|
|
|
240
273
|
# bare "0.3.6" carrying no commit counter at all, and MINIMUM_NIGHTLY_BUILD
|
|
241
274
|
# has nothing to compare against. Releases are cut from the same trunk, so
|
|
242
275
|
# a release is acceptable exactly when its own commit count clears the
|
|
243
|
-
# nightly floor.
|
|
244
|
-
# floor
|
|
245
|
-
#
|
|
246
|
-
#
|
|
247
|
-
# construction. Until upstream tags it, the release channel is
|
|
248
|
-
# deliberately unusable (nightly-only), reported with the standard
|
|
249
|
-
# too-old error. When 0.3.8 ships: verify
|
|
250
|
-
# `git rev-list --count 0.3.8` >= 8875 and update the lockstep table in
|
|
251
|
-
# process_test.rb.
|
|
276
|
+
# nightly floor. 1.0.0 (2026-10-02) is build 9994 — exactly the nightly
|
|
277
|
+
# floor, which is no accident: the floor was raised *to* the release so
|
|
278
|
+
# both channels gate the same commit. (0.4.1 = 9463 and 0.4.0 = 9058
|
|
279
|
+
# predate fixes the floor exists for.)
|
|
252
280
|
#
|
|
253
281
|
# INVARIANT: every MINIMUM_NIGHTLY_BUILD bump must also move this to the
|
|
254
282
|
# first release containing that build (`git rev-list --count <tag>` in the
|
|
255
283
|
# browser repo tells you). Leaving it behind would let the release channel
|
|
256
284
|
# silently accept a binary the nightly channel rejects.
|
|
257
|
-
MINIMUM_RELEASE = Gem::Version.new("0.
|
|
285
|
+
MINIMUM_RELEASE = Gem::Version.new("1.0.0")
|
|
258
286
|
|
|
259
287
|
class << self
|
|
260
288
|
# `lightpanda version` prints one of two shapes, and the gem supports
|
|
@@ -423,10 +451,6 @@ module Capybara
|
|
|
423
451
|
@options.port.to_s,
|
|
424
452
|
"--log_level",
|
|
425
453
|
"info",
|
|
426
|
-
# External stylesheet fetch (PR #2487, build >= 6353 — enforced by the
|
|
427
|
-
# floor). Always on so linked CSS contributes to checkVisibility /
|
|
428
|
-
# getComputedStyle; see .claude/rules/lightpanda-io.md limitation #5.
|
|
429
|
-
"--enable-external-stylesheets",
|
|
430
454
|
# Raise the inbound CDP WebSocket message cap from Lightpanda's 1 MiB
|
|
431
455
|
# default (Config.zig `cdp_max_message_size`) to 100 MiB, matching
|
|
432
456
|
# Chrome's inbound DevTools buffer. An inbound message over the cap is
|
|
@@ -441,12 +465,23 @@ module Capybara
|
|
|
441
465
|
"--cdp-max-message-size",
|
|
442
466
|
(100 * 1024 * 1024).to_s,
|
|
443
467
|
]
|
|
444
|
-
#
|
|
445
|
-
#
|
|
446
|
-
#
|
|
447
|
-
#
|
|
448
|
-
#
|
|
449
|
-
|
|
468
|
+
# Sub-resource loading is one comma-separated `--load-resources` value
|
|
469
|
+
# (Config.LoadResources is a packed struct the CLI parser fills from a
|
|
470
|
+
# comma list — the flag is NOT repeatable). Every kind defaults OFF
|
|
471
|
+
# since #3305 (build 8946).
|
|
472
|
+
# stylesheet — always on (PR #2487, build >= 6353) so linked CSS
|
|
473
|
+
# contributes to checkVisibility / getComputedStyle; see
|
|
474
|
+
# .claude/rules/lightpanda-io.md limitation #5. The spelling
|
|
475
|
+
# `--load-resources stylesheet` is a fatal UnknownOption below 8946,
|
|
476
|
+
# which the floor clears.
|
|
477
|
+
# image — opt-in (upstream #3230, build >= 8834): images never feed
|
|
478
|
+
# the DOM predicates, so the default spends no bandwidth on them.
|
|
479
|
+
# See Options#load_images.
|
|
480
|
+
# iframe / worker — deliberately NOT here. Browser#configure_loading
|
|
481
|
+
# re-enables both over CDP (LP.configureLoading) per BrowserContext.
|
|
482
|
+
resources = ["stylesheet"]
|
|
483
|
+
resources << "image" if @options.load_images
|
|
484
|
+
base.push("--load-resources", resources.join(","))
|
|
450
485
|
extra = ENV.fetch("LIGHTPANDA_EXTRA_ARGS", "").split
|
|
451
486
|
base + extra
|
|
452
487
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: capybara-lightpanda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.14.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Navid Emad
|
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
129
129
|
- !ruby/object:Gem::Version
|
|
130
130
|
version: '0'
|
|
131
131
|
requirements: []
|
|
132
|
-
rubygems_version: 4.0.
|
|
132
|
+
rubygems_version: 4.0.20
|
|
133
133
|
specification_version: 4
|
|
134
134
|
summary: Capybara driver for the Lightpanda headless browser
|
|
135
135
|
test_files: []
|