puppeteer/experimental/juggler
Andrey Lushnikov cd678fb591
chore(juggler): Roll Firefox to 120450a2 (#3842)
This patch:
- rebaselines C++ patchset atop of [Global Firefox Reformat](https://bugzilla.mozilla.org/show_bug.cgi?id=1511181)
- rolls firefox to [120450a2](120450a2c5)
- splits out preference installation step from Puppeteer-Firefox's
  `install.js` into a separate
  `puppeteer-firefox/misc/install-preferences.js`. This script is
  re-used to install preferences when run with a custom executable path.
- fixes issue with ScrollbarManager that was re-injecting the same
  stylesheet multiple times
2019-01-25 15:25:54 -05:00
..
patches chore(juggler): Roll Firefox to 120450a2 (#3842) 2019-01-25 15:25:54 -05:00
scripts feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
src chore(juggler): Roll Firefox to 120450a2 (#3842) 2019-01-25 15:25:54 -05:00
.cirrus.yml feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
.gitignore feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
Dockerfile feat: introduce puppeteer-firefox (#3628) 2018-12-06 11:24:00 -08:00
FIREFOX_SHA chore(juggler): Roll Firefox to 120450a2 (#3842) 2019-01-25 15:25:54 -05:00
README.md chore(juggler): Roll Firefox to 120450a2 (#3842) 2019-01-25 15:25:54 -05:00

Juggler

Juggler - Firefox Automation Protocol for implementing the Puppeteer API.

Protocol

See //src/Protocol.js.

Building FF with Juggler

  1. Clone Juggler repository
git clone https://github.com/aslushnikov/juggler
cd juggler
  1. Checkout pinned Firefox revision from mozilla github mirror into //firefox folder.
SOURCE=$PWD bash scripts/fetch_firefox.sh
  1. Apply juggler patches to Firefox source code
cd firefox
git am ../patches/*
  1. Add Juggler to Firefox. NOTE: On Linux, symlinks work. On OSX, files have to be copied.
# LINUX:
ln -s $PWD/../src $PWD/testing/juggler
# OSX:
cp -r $PWD/../src $PWD/testing/juggler
  1. Bootstrap host environment for Firefox build and compile firefox locally
# OPTIONAL - bootstrap host environment.
./mach bootstrap --application-choice=browser --no-interactive
# Compile browser
./mach build

Troubleshooting when building FF on Mac

Black screen after FF Build

As of Jan. 2019 there is a known bug that will cause an entirely black screen when running the nightly build of firefox built with the MacOSX SDK version 10.14.

The easiest fix right now is downgrading your MacOSX SDK.

To do so:

  1. Go to this repo and install any SDK version < 10.14 (e.g. 10.13 works fine)

  2. In the juggler/firefox folder:

echo "ac_add_options --with-macos-sdk=path/to/sdk" >> .mozconfig
# your SDK might be located at
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
  1. run ./mach build again

Missing headers in /usr/include

On MacOS 10.14 (Mojave) you might run into issues when building FF.

The error is related to a change in the xcode-select installation

To workaround this issue you can simply run:

# Write missing headers to /usr/include
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Running Firefox with Juggler

Juggle adds a -juggler CLI flag that accepts a port to expose a remote protocol on. Pass 0 to pick a random port - Juggler will print its port to STDOUT.

./mach run -- -juggler 0

Uploading builds to Google Storage

Firefox builds with Juggler support are uploaded to gs://juggler-builds/ bucket.

Project maintainers can upload builds. To upload a build, do the following:

  1. Install gcloud if you haven't yet.
  2. Authenticate in the cloud and select project
gcloud auth login
gcloud config set project juggler-builds
  1. Make sure firefox is compiled; after that, package a build for a redistribution:
cd firefox
./mach package
  1. Archive build and copy to the gbucket

We want to ship *.zip archives so that it's easy to decompress them on the node-side.

  • Linux: ./scripts/upload_linux.sh
  • Mac: ./scripts/upload_mac.sh