- Remove the check for 32 vs. 64 bit, since we only support 64 Windows
since a while
- Introduce `$ErrorActionPreference = 'Stop'` which is a best practice
otherwise the code would have continued running even a statement/line
was failing. E.g. download failed, it would still try to install
- `$ms.DownloadFile` checks for the status code internally, so we are
safe regarding this, it will throw otherwise.
This won't fix https://github.com/microsoft/playwright/issues/26591 but
makes the code more safe and might be related.
Although very common, bash is not guaranteed to be located at
`/bin/bash`. NixOS is an example of this.
More commonly, `/bin/bash` can be quite out of date. An example of this
is MacOS's version of `bash`. This realistically won't affect Playwright
but it's worth noting. You can technically update MacOS's system version
of bash but you need elevated permissions to do so.
By using `/usr/bin/env bash` instead of `/bin/bash` we can execute
Playwright's bash scripts in like NixOS and generally improve the
selection behaviour for bash in other systems too.
Some discussion of why it's worth favouring `/usr/bin/env bash` over
`/bin/bash`:
- Discusses `/bin/bash` missing in NixOS:
https://discourse.nixos.org/t/add-bin-bash-to-avoid-unnecessary-pain/5673
- Some general commentary on why `/usr/bin/env bash` is favoured:
https://askubuntu.com/a/1402721
- Points out how old bash is in MacOS:
https://itnext.io/upgrading-bash-on-macos-7138bd1066ba
Improves situation at #5501
This removes everything related to docker integration experiments that
we conducted over the last 6 months.
I'll send a follow-up with an alternative suggestion that was demo'ed on
a team meeting in the end of December.
This patch adds a reverse proxy in front of novnc and playwright
server inside the container.
As a result:
- container exposes a single HTTP port to the host
- all Playwright clients can connect using this exposed port, e.g.
`http://127.0.0.1:5400`
- navigating to the exposed port in the browser lands on a nice HTML
page
with a link to view container screen
- users can also manually navigate to `http://127.0.0.1:5400/screen` to
view screen
This patch implements a new mode of network tethering for Playwright
server & its clients.
With this patch:
- playwright server could be launched with the
`--browser-proxy-mode=tether` flag to engage in the new mode
- a new type of client, "Network Tethering Client" can connect to the
server to provide network traffic to the browsers
- all clients that connect to the server with the `x-playwright-proxy:
*` header will get traffic from the "Network Tethering Client"
This patch also adds an environment variable
`PW_OWNED_BY_TETHER_CLIENT`. With this env, playwright server will
auto-close when the network tethering client disconnects. It will also
auto-close if the network client does not connect to the server in the
first 10 seconds of the server existence. This way we can ensure that
`npx playwright docker start` blocks terminal & controls the lifetime of
the started container.
This patch introduces hidden commands to control container
lifecycle:
- `npx playwright docker install-server-deps` to install fluxbox,
vnc, novnc & to configure them.
- `npx playwright docker run-server` to run a server inside the
container.
Drive-by: remove old version of container image when building a new
version with the same name. This way we won't pile up untagged
container images.