Instead of building firefox using `//browser_patches/buid.sh ff-beta`,
one can use `//browser_patches/repack-juggler.mjs ff-beta`.
The script will download the last Playwright build, and repack
Juggler and preferences there.
This way bash won't expand and post-process variable values in any way.
The changes are driven with
[`shellcheck`](https://github.com/koalaman/shellcheck)
Browsers require particular xcode versions to be installed on the host
machine to produce successful build.
This patch starts using explicit xcode versions for all mac browser
builds.
When Firefox decides to perform an http->https redirect based on HSTS
information, it issues an "internal" redirect and cancels the http request.
Since there is no response for the http request, we forge 307 redirect
in this case, following Chromium lead.
The relevant code is in nsHttpChannel::StartRedirectChannelToHttps.
With this change, the script is now 2-stage:
- first, prepare browser build with `repack-juggler.js --prepare`
- afterwards, run the script to repack tot juggler version with the
bubild
This patch adds a new script -
`//browser_patches/firefox/repack-juggler.mjs`
This script lets you test Firefox changes if they are Juggler-specific
without firefox checkout / compilation.
The `repack-juggler.mjs` script does the following:
- downloads the latest build of Firefox-with-juggler
- finds an `omni.ja` file with Juggler files inside
- replaces juggler in omni.ja with the current juggler files in the index
Before that it actually didn't install all needed dependencies and failed after that when starting the compiler suite. WebKit also installs dependencies with apt, so it should be fine to install them on OS level.
- to read post data of requests, we have to read stream
- to restore the stream later on, we have to rewind it back
- however, if the stream is large enough, it cannot be rewound back
This patch starts cloning post data streams if possible to avoid
back-rewinding them later on.
References #4704
Merging conflicts:
038f367c30
After this roll, we no longer require our custom `onFrameLocationChanged` instrumentation
since gecko now fixed the `NOTIFY_LOCATION` behavior so that it works
for same-document navigations inside iframes.
browser(firefox): properly initialize debugging pipe on windows
Firefox on Windows has 2 launch modes:
- default: a special "launcher process" is used to start browser as a
sub-process
- non-default: browser process starts right away
Firefox has a logic to detect how successful was the use of the
launcher process to do self-recovery when things go wrong. Namely:
- when attempting to use launcher process, firefox records a timestamp
of the attempt beginning
- once the launcher process successfully launches browser sub-process,
firefox records another timestamp of the completion
On a new launch, firefox checks what timestamps are present. If there's
a timestamp that signifies start of launcher process, but no successful
timestamp, it decides that last "launcher process" use was not
successful and falls back to launching browser right away.
When launching 2 firefox processes right away, the first process
uses attempts to use launcher process and records the first timestamp.
At the same time, the second instance sees the first timestamp and
doesn't see the second timestamp, and falls back to launching browser
right away. Our debugging pipe code, however, does not support
non-launcher-process code path.
This patch adds support for remote debugging pipe in case of
non-launcher-process startup.
Drive-by:
- disable crashreporter altogether
- remove stray dcheck that breaks firefox debug compilation
- disable compilation of firefox update agent
- do not use WIN32_DISTRIB flag unless doing full builds since
it kills incremental compilation
References #4660
**Preamble**
1. We're trying to setup a windows-based github self-hosted runner in the
playwright-internal repo.
1. Commands on Windows are mandated to have total arguments length
less then 32767 characters.
1. On windows, github self-hosted runner framework puts repository
checkout at `c:\w\playwright-internal\playwright-internal`
1. Our scripts create a checkout at
`c:\w\playwright-internal\playwright-internal\browser_patches\firefox\checkout`
1. One of the scripts in Firefox buildsystem tries to execute a command,
passing lots of absolute paths to various webidl's
1. The command fails due to restriction in (2)
**Problem**
Firefox build fails since checkout is deeply nested and hits max arg
size on windows.
**Solution**
This patch introduces a new variable `FF_CHECKOUT_PATH` that is
respected by all browser-related scripts. This way we'll be able
to checkout firefox to `c:\firefox` and avoid hitting long arguments
limit.
The `$PROGRAMFILES` variable is defined per the bitness of the
application: 32-bit shells get `C:\Program Files (x86)`, whereas
64-bit shells get `C:\Program Files`.
Visual Studio, however, has only 32-bit build and is always located in
the `C:\Program Files (x86)` folder.
This patch fixes `//browser_patches/firefox/build.sh` on 64-bit windows
shell.