Repository navigation
Releases
Releases · oss-invisible/playwright
v0.53.1
v0.52.1
Changed
- Pins invisible-core 64.73.0 (same engine, firefox-64). The compositor is now declared in software on every machine, as a
retail Firefox reports on a machine without a usable GPU, and never read from the host. Before, the hardware compositor
was declared over a software adapter, which cost about 6x the CPU in the GPU process. - Windows: the engine is created inside a job of its own, so a launch no longer scans every process of the machine to bind
the engine's tree. (#498) - Several browsers in one async program no longer slow one another down:
connect()starts no thread on the event loop (#497).- The virtual display of
headless=Truestarts off the event loop (#499). - Closing a browser waits for its processes and removes its profile without holding the loop that serves the others:
with four browsers in one process the loop was held for up to about 0.5 s per close, and is not held now (#503).
- Comments, the fork notes and one test message no longer point at scripts that were deleted (the transport comparison scripts and the prefs byte-parity gate: no round ran them). No behaviour changes. (#458)
Added
page.expose_function,page.expose_binding,context.expose_functionandcontext.expose_binding, as in Playwright: the page calls a Python function and gets a promise (the value, a rejection when the function raised, an await when it is async). The page sees the function and nothing else (no name of ours on the window, no init script); an engine withoutPage.addBindingis refused with a clear sentence. Arguments and results cross as JSON. (#471)Locator.screenshot()andElementHandle.screenshot(): a picture of the element, as in Playwright, in the page, in a frame of another site and in a frame nested in it. (#470)
Fixed
- A context init script added after a page exists runs once in it, not twice. (#469)
- A CORS preflight (an OPTIONS request that no route holds) is no longer reported to the client, as in Playwright's own server:
page.on("request"),routeand a request counter hear of one request fewer for each preflighted fetch of the page. (#467)
Tests
- Every test module is checked to leave no browser open (a census of the connection threads, which needs no package to run). (#497, #500)
- Software compositing is declared: the compositor in use, the CPU of the GPU process, and the bytes a page reads compared
against a recorded reference, on Linux and Windows. (#501) - The UDP bench survives a loaded Windows machine, and its verdict says what it saw. (#502)
v0.52.0
Changed
- Pins invisible-core 64.71.0 and with it the engine firefox-64. A request a page causes now leaves in the context of that
page, by that context's proxy and resolver: the name of a TURN server over TCP, the OCSP request of a certificate, the TLS
over a tunnel, the Safe Browsing completion of a page load. Nothing of a context with a proxy goes out DIRECT when a proxy
lookup fails or the context has just closed. On Linux the profile lock no longer looks up the machine's host name. - Typing: each key is sent at its planned time measured from the start of the action, so a late reply no longer shifts the
keys after it, and the engine delivers each key at once with its event born the declared latency in the past. Measured
against stock Playwright Firefox, 20 runs per cell, slip of the last key against the plan (median): Windows 635 ms before,
6 ms now (stock 122); Linux 554 ms before, -5 ms now (stock 91).
Fixed
- Screencast: a frame that arrives while the start of the screencast is being answered is held and acknowledged,
not dropped, so the stream no longer dies from its first frame (the engine keeps one frame in flight and waits for its
acknowledgement). - No thread is started on the engine connection's reader any more (the adoption of a new page and the file chooser hand
their work to one long-lived starter). On Windows under load a Thread.start there held every event behind it; without
instrumentation, goto(..., wait_until="networkidle") on pages that replace themselves missed 1 in 1200 instead of 4.
Tests
- The suites "nothing of a context leaves but through its proxy" (a witness of every direct arrival, the engine's resolver
log as the sink of native lookups), on Linux and Windows, including two contexts with their own proxies at once and a
PeerConnection of a torn-down window. - Windows: the isolated-page test moves the page when the test says so instead of on a 500 ms timer; the sandbox test
reads again a process that is still starting.
v0.51.1
Changed
- Pins invisible-core 63.68.0 (core fixes on the same firefox-63 engine: two sessions starting together on Windows no longer fail on the shared font-manifest cache; no MOZ_*, GL or toolkit variable of the host reaches the engine; GitHub is asked for the latest GeoIP database once a day, not on every launch; mouse moves carry the pressed buttons; a CORS preflight does not count for networkidle).
- The project moved to the oss-invisible GitHub organization: every GitHub link, the issue templates and the package URLs point to github.com/oss-invisible/playwright. The PyPI name and the import name do not change; the old addresses redirect.
Fixed
- A popup (a
window.openor atarget=_blanklink) could be handed to the client atabout:blank, with the blank page'sload, when it
was opened with no route on the context: the commit of its address, or itsDOMContentLoadedandload, arrived while the page was being
handed from its buffer to its dispatcher and was told to nobody (page.urlstayedabout:blank, orwait_for_load_state("load")timed
out). Measured on Windows with the library's client in the same process,test_popups_reach_the_client_e2e.pyx20 on 4 workers: 3 runs
red with the published firefox-62 engine and 11 with firefox-63. The page is now handed over in one step: what the client was not told is
said once, in order, and nothing the engine sent in that period is lost. - The same hand-over dropped every event that is not a request: a
consolemessage, apageError, adialog(analert()that opened
while the popup was being built blocked its page for good, because no client had been told of it and none could answer it), acrash, a file chooser. All
of them are given back now, in the order they arrived. The only bound left is the memory of the buffer (512 events): an event beyond it is
lost and aRuntimeWarningsays how many, once per page. - The hand-over holds when the engine's reader, the adoption and a close run at the same time: a
loadis told to the client once (not twice,
sopage.on("load")runs once); an event the engine sends while the held ones are being given back waits for them (a response is never handled
before its request); a document committed at the same address as the previous one is told; a page closed while it was being adopted is not given
frames, and is not announced, after its__dispose__; one frame never gets two dispatchers. - A popup could still be handed to the client at
about:blank(or with its navigation pending again, and "Execution context was destroyed" in its
first evaluate) when the destination committed while the events the page had missed were being replayed to it: the engine's reader went on
delivering the live events to the lifecycle, and the replay then brought older ones after them. The page now subscribes its readers and is
handed the missed events in one step, with the delivery of the sessions' events held, so a live event never overtakes the replay.
With the three corrections together, on Windows with the library's client in the same process, under load: 680/680 and 256/256 popup cases
green (run 43261858525). Control+Aselects all in an<input>and a<textarea>on Windows, on the published engine and the core this package pins: a new end-to-end
test (five ways to press the shortcut, in-process and served to the stock client), run bye2e.ymlon Windows, 20/20 green (run 43262320744).- Tests only: the e2e tests of the test servers take their ports from one sequence (no two servers draw the same one); the two tests that read a
consecutive pair of host ports run alone, after the parallel tests; the sandbox e2e (the browser's seccomp filter) runs in a step of its own that
turns unprivileged user namespaces on, and is left out of the normal run; every leg launches with a GeoIP database the repository builds (same
bytes every run, no download); the CodeQL alerts of the test code are fixed; the install job waits for the package index through both installers;
the raw Juggler tests wait forPage.readyand the main frame instead of a fixed time.
v0.51.0
Changed
- Engine firefox-63 through invisible-core 63.67.0, which this version pins (63.67.0 is 63.66.0 with the protocol mirror regenerated from the published engine; the mirror of 63.66.0 differed from it). Behind a proxy: names are resolved by the browser's own
DNS-over-HTTPS through the proxy (not by the machine's resolver; checked with a resolver trap on Linux), WebRTC and HTTP/3 send
their UDP through the proxy's relay when its UDP was measured to leave from the same address as its TCP, and a proxy whose UDP
does not hold (including one whose UDP leaves from another address) is treated as a router that drops it (HTTP/3 falls back to
HTTP/2, ICE gathers no server-reflexive candidate). A proxy given to a context declares its own measured UDP exit. The interface
list WebRTC gathers is the network the session declares. - Behind a SOCKS5 proxy the proxy now receives addresses, not names (the names are resolved by the DNS-over-HTTPS through it); a proxy
that cannot carry HTTPS to mozilla.cloudflare-dns.com resolves no name. - A STUN server list can be given at launch (
udp_stun_servers) for the measurement of the proxy's UDP. - Every context carries the position the core declares for the session (the geolocation override of the context).
- The package's launcher and server refuse the two prefs that govern the launch counter,
invisible_firefox.usage_ping.enabledand
invisible_firefox.usage_ping.url, inextra_prefs(and in thefirefoxUserPrefsof a served launch). The engine counts launches with
an anonymous GET to theusage-counterrelease of the engine's repository (feder-cr/firefox_antidetect_patch).
Added
preload_newtab=Falseturns off the preloaded New Tab page, on request only (InvisiblePlaywright,
invisible_playwright.async_api.InvisiblePlaywrightandlaunch_server): by default the browser keeps it, as a retail Firefox does.
A retail Firefox keeps the New Tab page ready in a content process of its own; with the option it is not started.Nonewrites
nothing,Truesays the retail value aloud, and abrowser.newtab.preloadinextra_prefswins over it. Needs invisible-core
63.66.0 or later. Measured on Windows (run 43211271731), on an engine build of the firefox-63 candidate line (not the published engine), one
page of a site, five alternating runs: the browser's processes together take 448-454 MB as shipped and 231-239 MB with the option
(private memory 301-307 against 158-171 MB).
Fixed
- A request the browser resumed and whose channel is replaced and cancelled before the replacement starts (a
fetchwith
keepalive, a beacon) is reported as failed, so it no longer keepsnetworkidlefrom arriving (engine firefox-63). - A navigation the page overtakes (
location.replace) ends, and the document that overtook it is told (engine firefox-63). - A click in a frame under a CSS transform is mapped back to the point the frame shows, and a click in a frame scrolls the
element in even when its point is inside the main viewport (invisible-core 63.66.0). request.resource_typeagrees with the pinned driver: a beacon isbeaconand a CSP report iscspreport(it saidother).- A download whose finish is seen before its announcement is marked finished:
save_as,pathandfailureused to wait for ever on it.
The early finishes the browser keeps are bounded (64) and forgotten with their context. (That the engine sends a finish before the
announcement is not proven; the path is defensive.) - The opener kept for the downloads of a target whose adoption failed lives until the engine detaches the target, and none is
made for a target already detached. - Tests only: the end-to-end tests that look at content processes ask for the processes of a site by its name and no longer compare two counts.
Known differences from stock Playwright
What a script that drives the browser can observe, from the configuration of Playwright's own Firefox and of a retail Firefox (no
comparison run is saved). The result of a window.open (null or a window) is read by the page; the others are what the script sees.
- A
window.openfrom a script with no user gesture is blocked, as in a retail Firefox. Playwright's own Firefox turns the popup
blocker off (dom.disable_open_during_loadfalse in itsplaywright.cfg); a retail Firefox keeps it on, and so does this browser. So
page.evaluate("window.open(url)")returnsnullto the page and nopageevent comes; the samewindow.openfrom a click opens
the popup on both. To get stock's behaviour: open the popup from a click; or pass
extra_prefs={"dom.disable_open_during_load": False}for the session, knowing that a page then sees a browser that differs from a
retail Firefox.
Known issues
- A popup opened without a route can be announced while it is still on
about:blank. A popup opened with no route on the context
(atarget=_blanklink, orwindow.openfrom a click) can be announced to the client while it is still onabout:blank; itsurl
then staysabout:blank, or itsloadnever arrives. Seen on a Windows runner with the library's client in the same process and four
workers running the popup tests in parallel (test_popups_reach_the_client_e2e.py, 20 runs): with the firefox-63 engine 17 cases of 640
in 12 of 20 runs; with the published firefox-62 engine (so also with 0.50.1) 15 cases of 640. Both causes found are in the wrapper: the hand-over of
a new page to the client, and the replay of a new page's events while live ones are being delivered. The correction of the first alone,
not in this release, lowers the red cases over 20 runs from 15 to 2 with engine 62 and from 17 to 13 with engine 63; the correction of the
second is under test. On Linux no run was red (0 of 20). Not measured: a served
launch with numbers of its own, other machines, a run without parallel workers, macOS.
v0.50.1
0.50.0 was tagged and never published: its end-to-end gate was red on two tests that counted processes.
0.50.1 is 0.50.0 with those tests corrected.
Changed
- Engine firefox-62 through invisible-core 62.63.0, which this version pins: firefox-61 plus Fission
and the Juggler for frames in another process. Whengotoreturns, the frames below have the
address of their first document (an iframe of another site used to be listed with an empty url
for a moment); agototo the address the page is already at ends; a late event of a frame that
left the page no longer brings it back intopage.frames. - Fission: iframes of another site run in a content process of their own (isolation strategy 1,
fission.autostarton, four isolated content processes), as in retail Firefox on desktop. The
strategy comes from the invisible-core baseline of the firefox-62 engine, whose Juggler reaches a
frame in another process like any other. The tests that held strategy 0
(tests/test_cross_origin_iframe.py) now hold strategy 1, and the Fission end-to-end tests
(frame tree, element to frame, geometry, input, crash of an iframe process, identity of the
iframe and of its page) run on that engine.
Fixed
goto(wait_until="networkidle")arrives on a page that is reused for many addresses, and on a served browser whose
context routes every request, as with a stock Firefox. Two causes, both ours. A route answered after the browser had
already closed its request (a fetch the page aborted, an image it replaced, an iframe it removed, a beacon cancelled
with its document) came back to the client as an error, which the client kept for the whole connection and raised on the
next route command; that command was never sent, its request stayed held in the engine, and so on down the page. The
server now takes such an answer as done, whatever wording the engine gives it ("Cannot find request", or "NS_BINDING_ABORTED"
when the channel was cancelled while the answer was on its way), as Playwright's own server does. The same defect was found a month earlier by richardpowellus
(#351), on the favicon of the page agotohad just left; his test is part of this release. And the core counted the requests in flight
with one integer per page, never reset by a navigation, so one request whose end never arrived kept every later address
from going idle (invisible-core 62.64.0 keeps them by request id, per document, and does not keep the requests of a
frame that already left: a beacon sent atpagehideis announced after its frame is gone).- A
gotosent right afternew_pageis no longer "interrupted by another navigation to about:blank" on a loaded machine. The page was
handed to the caller as soon as its main frame was announced, while the engine had not yet committed the page's own initial
about:blank; a navigation answered before that commit lost to it. The page is now handed over when the engine says it is
ready (Page.ready), as Playwright's own page is (invisible-core 62.65.0,Lifecycle.wait_for_page_ready; a page closed before
it was ready ends the wait with an error at once). - A launch that names no session (Playwright's own
BrowserType.launchagainst the server) gets a
session composed the wayInvisiblePlaywright()composes one: prefs, environment and, behind a
proxy, the egress the page reads as its WebRTC address. It used to come up with Mozilla's
defaults, and on Linux its firstnew_pagefailed with "Unexpected number of tabs in the new
window: 2". - A frame that left the page (an iframe a script removed) answers a call with "Frame was
detached", as Playwright does, not "Target page, context or browser has been closed". grant_permissionsuses the permission names of the engine.geolocationandnotificationsused
to reach the engine under the web names while it keeps a grant undergeoand
desktop-notification, so a page of a context that had been granted geolocation and given a
position was still denied. The names are those of the Playwright client for this browser
(geolocation,persistent-storage,push,notifications,screen-wake-lock); any other name
raisesUnknown permission, as it does there, and a grant with no origin is a grant for every
origin.- The end-to-end tests that count content processes count the ones that host a site, not every content
process that is new. The engine keeps a pool of preallocated processes and refills it whenever it gets
to it, so a refill landing between two reads looked like a process the test had caused (a same-site
frame, a closed context with a service worker that never stops). Measured on firefox-62: a closed context
leaves no process of its site. On Linux the process is named by the site it hosts; elsewhere these
tests skip.
v0.49.1
Changed
- Engine firefox-61 through invisible-core 61.62.0, which this version pins: firefox-60 plus four
fixes. A context that ends no longer leaves a content process behind when a service worker
that never stops keeps it alive (the engine kills the processes of the container that stay);
the shared font resources of a closed window leave WebRender's pool with it;Page.screenshot
empties its canvas on every way out;Page.setEmulatedMedianames the media features it
refuses, in English. - A context route turns the context's cache off while it is active, as Playwright does.
Fixed
page.request_gc()works on a served browser. It sent the engine'sHeap.collectGarbageon the
browser-level connection, whose handler does not have it, so every call failed with
Handler for does not implement method "Heap.collectGarbage"; it is now sent with the session
of the page, as the engine answers it.
v0.49.0
Changed
- Engine firefox-60 through invisible-core 60.61.0, which this version pins: firefox-59 plus
the Juggler's memory fixes. A tab no longer keeps the documents it left alive (they used to
stay as detached windows after leaving the back/forward cache), and a main-frame navigation
drops the response bodies of the documents it left, as Chromium does:response.body()of
such a response raises the evicted error Playwright already returns for Firefox.
v0.48.1
Added
launch_server,launch_server_asyncandRemoteServerare importable from
invisible_playwright, and the README's "Serving one browser to many clients" has a
complete example: a server, and a Playwright for Python client that connects to its
ws_endpoint.
Changed
- invisible-core 59.60.0, which this version pins. The browser never opens its crash
reporter: the launch environment carriesMOZ_CRASHREPORTER_DISABLE=1, so an engine that
refuses a launch no longer leaves a "Crash Reporter" window on a Windows desktop. - The e2e run stops at the first refusal of the engine instead of launching the browser for
every test (a change to the test suite, not to the package).
v0.48.0
Added
launch_server()serves one browser on a WebSocket to any Playwright client: the
Playwright initializer is the one of protocol 1.62, a call's timeout is read from its
metadata or its parameters, a Dialog is a protocol object, and the pointer's path is
drawn by the server, once, for every client.
Changed
- Engine firefox-59 (Firefox 159.0), through invisible-core 59.59.0, which this version
pins. On Linux WebGL draws on the engine's own GL, never the host's, under X11 too, and
every extension the persona declares answers as on Windows. The same seed gives the same
pointer path, typing and persona on Python 3.11 to 3.14 (59.59.0 replaces the two builtins
that differ between versions). - The server collects its oldest protocol objects as Playwright's does, with a lower limit
forRequest,ResponseandRoute(2000, not 10000; nothing younger than 10 seconds).
A program that holds more than 2000 requests or responses in hand for longer than 10
seconds gets "Target closed" on the oldest ones.INVPW_GC_LIMITSchanges the limits. - A closed context leaves nothing in the server's registry.