When a GET subresource was captured within replayMaxAgeSeconds, serve it
from the WARC file instead of fetching it again, so that pages sharing
resources don't refetch them once the browser has evicted them from its
cache or the page loads in another browser. Redirects back to the same
canonical URL aren't replayed as they would loop. Part of #831.
Revisits take the body from the record they refer to. Files are tried
under both their closed and .open names, as a file may be closed between
lookup and read.
Keys captures by the CrawlURI's canonical string and fetch time, newest
first, so later lookups find the latest capture of a resource the same
way the frontier identifies it. Revisits store the location of the
record they refer to. Part of #831.
What a server returns for missing URLs can change during a crawl, for
example once it has set a session cookie. When a page has the same
content as another recent page from the server and doesn't match any
probe, probe the server again, up to maxProbes probes in all (default
2). Pages matching any probe fingerprint are treated as soft 404s.
Move the soft 404 fields and methods from CrawlServer into
Soft404Detector.State, which CrawlServer holds and creates when first
requested. This keeps the detector's logic in one place and leaves
servers the detector never looks at without the state.
An app shell served for every path links to e.g. assets/css/app.css.
Fetched at /assets/css/app.css, that link looked like an echo of the
page's own URL and was removed before fingerprinting, so the page no
longer matched the probe, which got the same shell with the link
intact. That missed the first level of a relative-link trap.
Also compare the content without echoes removed.
Limiting probes to servers reached as seeds or by navlinks missed
soft 404 traps that grow through embeds and redirects. For example, an
in-scope host that serves its app shell for unknown paths: the shell's
relative embed links resolve one directory deeper each time, and every
response is the shell again.
Probe any server that returns an HTML page instead. Servers that only
serve non-HTML content, such as image CDNs, still aren't probed.
On GitHub's runners the first non-loopback address can be that of an
idle Docker bridge, and Docker's NAT rule rewrites the source of a
request from it to another address, which the proxy then refuses.
By default the Grid picks Chrome or Firefox, whichever it has a free
slot for, which on a node that detects every browser on its machine
could be either.
A browser that can't reach the proxy, through a firewall, a wrong
proxyHost or an allowlist missing its address, would otherwise count as
up and fail every page. As the last step of a launch, load an https page
through the proxy with a page ID, which the proxy answers itself, so that
CONNECT and its TLS interception are checked too. A browser that fails
to load it, or doesn't reach the proxy within 10 seconds, fails to
launch.
Selenium Grid ends a session after 300 seconds without traffic by
default, which is no longer than BrowserProcessor's default idle time
before closing a browser, so a page given to an idle browser could find
its session gone. BiDi commands count as traffic, so send a cheap one
every minute until the driver is closed.
http:// and https:// entries in browsers, or GridBrowser beans with
credentials, each create one session on a Grid. Grid nodes reach the
recording proxy at proxyHost, which defaults to loopback for a Grid
that shares this machine's loopback; otherwise the proxy needs to listen
off loopback and allow the nodes' addresses.
Remote browsers need the proxy to listen on an address they can reach.
It keeps listening on loopback too, for browsers on this machine.
Requests from addresses other than loopback and the allowed ones get
403, so opening the proxy to the network doesn't make it an open proxy.
Creates the session with POST {endpoint}/session and webSocketUrl: true,
connects to the reported WebSocket and deletes the session on close.
Selenium Grid reports its WebSocket URL with an internal address, such
as the container's IP and port, so only its path is kept and the scheme,
host and port come from the endpoint. Supports HTTP Basic authentication.
Waits up to ten minutes for the session, as Grid queues the request
while it has no free slot, but gives up when interrupted. Deleting the
session doesn't wait for the response, so stopping isn't held up by an
unreachable Grid.
A driver whose subclass doesn't end the connection by ending the
browser, such as one attached to a session on a remote endpoint, would
otherwise leave it open.
Separates the WebSocket, command and event handling from owning the
browser process, so that another subclass can attach to a session that
already exists.
ChromeDriver with --port=0 picks a free port before binding it, so two
launched at the same moment can pick the same port and one exits with
"IPv4 port not available". BrowserProcessor launches all its browsers
concurrently, which made testSeveralBrowsers flaky and could stop a crawl
with several local ChromeDrivers from starting.
Runs when a release is published, on demand, and daily to rebuild the
latest release when the eclipse-temurin base image digest has changed.
The base digest is recorded in the org.opencontainers.image.base.name
label so the daily check can compare against the published image.
Requires the DOCKERHUB_TOKEN secret and DOCKERHUB_USERNAME variable.
When a page links to the same URL both as an embed and via another hop
type, only schedule the embed. Previously whichever came first in the page
was scheduled and the rest dropped as duplicates by the frontier, so e.g. in
<a href=image.jpg><img src=image.jpg></a>
the image was queued as a navlink. Likewise, until rel=preload was treated
as an embed, the stylesheet in
<link rel=preload href=style.css as=style>
<link rel=stylesheet href=style.css>
was queued as a navlink (#824).
@codemirror/language 6.13 and @codemirror/legacy-modes 6.5.5 now import
@codemirror/streamparser, so the editors failed to load with an
unmapped bare specifier error.
The webarchive-commons 3.0.6 bump pulls in commons-lang3 3.22.0, whose
UnicodeUnescaper no longer throws on malformed \u escapes. Only test
the invalid code points ExtractorJS rejects itself.