Commit Graph
10039 Commits
Author SHA1 Message Date
Muki Kiboigo dff7e7a521 requests with Cookie header should privately cache 2026-11-16 07:10:32 -08:00
Muki Kiboigo 26ed996f38 treat proxy authorization header like authorization header 2026-11-16 07:10:32 -08:00
Muki Kiboigo 58918d9f88 more correctly differntiate between private and public cache entries 2026-11-16 07:10:32 -08:00
Muki Kiboigo 988f6d54d5 remove left over private entries 2026-11-16 07:10:32 -08:00
Muki Kiboigo cacb214baa add metrics for public vs private cache 2026-11-16 07:10:32 -08:00
Muki Kiboigo 020b93c2c4 clear cache scoped entries on deinit 2026-11-16 07:10:32 -08:00
Muki Kiboigo ea33d5bf95 more scoped cache work 2026-11-16 07:10:32 -08:00
Muki Kiboigo b84147153f properly use public for most things 2026-11-16 07:10:31 -08:00
Muki Kiboigo 3aeca75b66 scope based on browser id 2026-11-16 07:10:30 -08:00
Muki Kiboigo edf5d5c173 have cache take a scope for all operations 2026-11-16 07:07:31 -08:00
jaeminbird 2069f1cd78 http: fail a framed response whose connection is lost before its end
A RecvError after the headers was taken as a normal end of body whenever
the response had no Connection header (or Connection: close). That is
right for a close-delimited body, where a TLS peer closing without
close_notify ends it, but a body framed by Content-Length or chunked
encoding has its own end: losing the connection before it means the
response was truncated. fetch() and XHR resolved such responses as
complete, with whatever part had arrived, and a malformed chunked body
loaded as an empty 200.
2026-11-16 12:56:02 +08:00
Karl Seguin 05992d2d3f Merge pull request #4243 from lightpanda-io/navigate-intercept
`intercept` on `NavigateEvent`
2026-11-16 11:24:53 +08:00
Karl Seguin eebbda4718 Merge pull request #4662 from JulienLeal/fix/readable-stream-tee
streams: implement ReadableStream.tee() and values()
2026-11-16 11:24:39 +08:00
Karl Seguin 84e935220c Merge pull request #4637 from lightpanda-io/cdp-default-context-playwright
cdp: let Playwright use the default context before any page
2026-11-16 08:00:49 +08:00
Julien Breno Leal Ambrosio Ximenes 8eab4c4891 streams: implement ReadableStream.tee() and values()
Next.js App Router with `cacheComponents: true` tees the Flight stream
during hydration. Without tee() the page throws `I.tee is not a function`
and React never mounts (#4654).

tee() follows ReadableStreamDefaultTee: it locks the source and each
branch pulls one chunk at a time, so the source isn't drained ahead of
the branches. Both branches get the same chunk (no clone). Cancelling one
branch leaves the other flowing; the source is cancelled once both are,
with [reason1, reason2]. Only a locked stream throws; a closed or errored
source yields closed or errored branches.

values() returns the existing async iterator, which now also returns
itself from [Symbol.asyncIterator] so `for await (... of s.values())`
works.
2026-11-15 20:33:09 -03:00
Adrià Arrufat 117e07d1aa Merge pull request #4652 from jayhemnani9910/fix/markdown-definition-list
markdown: put definition list terms and details on their own lines
2026-11-15 21:17:55 +01:00
Adrià Arrufat c467c8c7d2 markdown: keep list items in a table cell on the row
A <li> in a cell gets the same space as <dt> and <dd> instead of a
newline. The cell's padding counts as a line start, so the first item
doesn't add a second space.
2026-11-15 20:52:29 +01:00
Jay Hemnani 583c0452b7 markdown: end the line after </dt> and </dd>, keep table rows on one line
An indented <dl> left a trailing space on each line, because the
whitespace after </dt> was written as a space. Inside a table cell,
write a space instead of a newline so the row stays intact.
2026-11-15 10:30:43 +05:30
Adrià Arrufat db20537bd3 Merge pull request #4640 from lightpanda-io/pandascript-docs-returns
docs: add a Returns column to the PandaScript method tables
2026-11-15 00:50:58 +01:00
Adrià Arrufat cb04be25a4 docs: describe PandaScript return values instead of quoting them
Action results carry the page state after the status prefix, goto
returns a promise, and evaluate is empty on save=.
2026-11-15 00:17:31 +01:00
Karl Seguin 69f1e64875 Merge pull request #4655 from lightpanda-io/indexdb-pending-request
idb: keep a pending request's JS object alive until its event fires
2026-11-15 07:14:16 +08:00
Karl Seguin f903bbf565 Merge pull request #4657 from lightpanda-io/cdp-with-frame
cdp: add withFrames option to LP.dump
2026-11-15 07:08:06 +08:00
Karl Seguin 03d7847f84 Merge pull request #4641 from lightpanda-io/dom-version-target
perf: dom_version on popover_open
2026-11-15 07:05:16 +08:00
Pierre Tachoire d7bca1759b cdp: add withFrames option to LP.dump
Same as fetch --with-frames: the html dump includes each iframe's
content document, nested iframes included. Other formats refuse it
with InvalidParams.
2026-11-14 19:06:16 +01:00
Pierre Tachoire 0eca3d68a7 idb: keep a pending request's JS object alive until its event fires
The identity map holds JS objects weakly, so a pending IDBRequest
could be collected before its success/error event. A fresh JS object
then received the event without the old one's expandos, which broke
Zone.js listeners (blank page on boodmo.com).

Hold a strong ref from submit/open/deleteDatabase until the event
has been dispatched.
2026-11-14 18:40:36 +01:00
Karl Seguin 3b83a34e0d Merge pull request #4645 from lightpanda-io/ci-flake-fix
ci: speed up a slow (and ci-failing) test
2026-11-14 11:59:12 +08:00
Karl Seguin c89c9a4480 Merge pull request #4644 from lightpanda-io/debug-crash-fix
crash: fix a debug-only crash on nytimes.com
2026-11-14 11:41:52 +08:00
Karl Seguin 90302b3c1a fix another slow CI failure 2026-11-14 11:39:59 +08:00
Karl Seguin b17cc61c55 ci: speed up a slow (and ci-failing) test
The test large.css had 100K rules, which, when parsed, has to generate a ton
of object. Keep the large css, but make it a big comment. It tests the same
thing without the overhead of the creating those rules.
2026-11-14 11:07:27 +08:00
Karl Seguin f2fb67139d crash: fix a debug-only crash on nytimes.com
skip stylemanager update on an element with a frameless document
2026-11-14 10:21:54 +08:00
Karl Seguin dafd063b6f Merge pull request #4482 from coolswood/agent/goto-timeout
script, network: make the goto timeout a real bound on the navigation wait
2026-11-14 08:37:21 +08:00
Karl Seguin 7a20388cae perf: dom_version on popover_open
popover_open no longer bumps dom_version...but a form-associated custom element
being upgraded now does (this can change a form-aware live collection).
2026-11-14 08:31:25 +08:00
Karl Seguin 959cc571c5 Merge pull request #4638 from lightpanda-io/run-cookie-file
agent: apply --cookie and --cookie-jar
2026-11-14 08:18:36 +08:00
Karl Seguin edf4c4e485 Merge pull request #4631 from lightpanda-io/decisions-gemini-opt-in
tools: ask Gemini Decisions only with LIGHTPANDA_DECISION_PROVIDER=gemini
2026-11-14 08:13:59 +08:00
Karl Seguin 70d5a4df6a add more handlers for WaitDeadlineExceeded 2026-11-14 08:07:09 +08:00
Karl Seguin 9075969113 contain check within HttpClient 2026-11-14 07:53:08 +08:00
coolswood 4fc28ae45b script, network: make the goto timeout a real bound on the navigation wait
Баг: script-API `page.goto(url, {timeout})` (и MCP-инструмент goto) не
ограничивал навигацию, пока в полёте парсер-блокирующий подресурс.
Замер на main: скрипт отвечает 9с + timeout 2000 → отклонение «navigation
timed out» на 9008мс (когда страница уже догрузилась); скрипт 25с →
отклонение на ~15с — это wall-clock curl (httpTimeout), а не таймаут
вызывающего.

Причина: дедлайн проверяется только МЕЖДУ тиками (Runtime.settleCompleted),
но один тик может висеть сколь угодно долго: при доставке ответа
(HttpClient.dispatchCompleted) синхронно работает парсер, и
парсер-блокирующий <script src> уходит в Transfer.submitSync — цикл
`while (in_progress) tickSync(200)` на стеке парсера. Снаружи этот цикл
не прерывается ничем, кроме ответа сервера или 15-секундного
curl-таймаута. strace это подтверждает: ~45 циклов ppoll(200мс) внутри
одного runner.tick(50).

Фикс: у HttpClient.Client появляется wait_deadline_ms — абсолютный
дедлайн текущего ожидающего, который выставляют навигационные wait'ы
перед каждым тиком и снимают после:
- Runner._wait (не-CDP путь: MCP goto/performGoto, действия, fetch-режим)
  публикует остаток своего timeout_ms;
- Runtime.driveAsync (script-API) — ближайший deadline среди pending goto.
Transfer.submitSync проверяет дедлайн до старта и после каждого
tickSync, а сам wait ограничивает min(200, остаток); по истечении —
abort передачи и error.WaitDeadlineExceeded: парсер продолжает без
этого ресурса (scriptAddedCallback логирует ошибку и идёт дальше —
как при любой ошибке загрузки скрипта), а вызывающий отклоняет
навигацию по таймауту. Те же проверки в циклах waitForPreload и
waitForImport. CDP-путь (_wait c is_cdp) не ограничивается: там _wait
вызывается помашечно по ~1с как слайс живости, а не как граница
навигации.

В Runtime.settleCompleted дедлайн теперь старше статуса .complete:
завершение, наступившее в том же тике, что и дедлайн (например из-за
abort'а блокирующего скрипта), остаётся таймаутом, а не «успешной
загрузкой»; честная ошибка (.err) по-прежнему .failed.

Тесты: в тестовом HTTP-сервере эндпоинты /goto_timeout/page?s=N и
/goto_timeout/script.js?s=N (парсер-блокирующий скрипт с задержкой N
секунд) + два теста Runtime: timeout 2000 при 9-секундном скрипте
отклоняется за ~2с (было 9008мс), а при 2-секундном скрипте и
timeout 15000 навигация резолвится, и блокирующий скрипт успевает
выполниться до резолва.
2026-11-14 07:53:07 +08:00
Karl Seguin 5e64c37e52 webdriver: allow session to be started with acceptInsecureCerts
Fixes: https://github.com/lightpanda-io/browser/issues/4615
2026-11-14 07:47:04 +08:00
Karl Seguin 2e783235b8 Merge pull request #4621 from lightpanda-io/webdriver-shadowroot
webdriver: add shadowroot endpoints
2026-11-14 07:44:00 +08:00
Adrià Arrufat 7511600b63 docs: add a Returns column to the PandaScript method tables
Each recorded tool now declares what its page method returns to a
script, and `zig build docs` renders it next to the call signature, so
the docs site no longer keeps a handwritten table of return values.
2026-11-14 00:38:50 +01:00
Karl Seguin 53727d6699 Merge pull request #4632 from lightpanda-io/targeted-dom-version-attribute
perf: target dom_version bump for attribute write
2026-11-14 07:08:53 +08:00
Karl Seguin d10bd8aec9 Merge pull request #4630 from lightpanda-io/test-cross-validate
tests: more test validation with chrome.
2026-11-14 07:08:40 +08:00
Karl Seguin 7377863df0 Merge pull request #4629 from lightpanda-io/idmap-allocator
mem: Move frame document's idmap to the main allocator
2026-11-14 07:08:27 +08:00
Karl Seguin 5437509e20 Merge pull request #4628 from lightpanda-io/recycling_allocator
chore: Make the RecyclingAllocator more accessible.
2026-11-14 07:08:16 +08:00
Karl Seguin 94d35237d0 Merge pull request #4627 from lightpanda-io/stylemanager-width-memo-record
perf: StyleManager move the Width memo to the element record
2026-11-14 07:08:04 +08:00
Karl Seguin 4f166db517 Merge pull request #4625 from lightpanda-io/stylemanager-element-records
perf: Store StyleManager record per-Element.
2026-11-14 07:07:51 +08:00
Karl Seguin 34bd2726bf Merge pull request #4624 from lightpanda-io/fetch-response-borrow
mem: fetch no longer copies body from transfer
2026-11-14 07:07:39 +08:00
Karl Seguin 6f97dbb1bf Merge pull request #4623 from lightpanda-io/stylemanager-inherited-group-wites
perf: StyleManager inline write cache clear
2026-11-14 07:07:27 +08:00
Karl Seguin 5f95dd4488 webdriver: add shadowroot endpoints
/element/{id}/shadow  <- get the element's shadowroot
/shadow/{id}/element  <- find element from shadowroot (POST)
/shadow/{id}/elements <- find elements from shadowroot (POST)
2026-11-14 07:06:32 +08:00
Karl Seguin bcf1bed622 Merge pull request #4619 from lightpanda-io/webdriver-display
webdriver: add a few simple endpoints
2026-11-14 07:04:19 +08:00