This is an overview of the steps needed to upgrade Chromium in Electron.
libcc
to a new Chromium versionGet the code and initialize the project:
$ git clone [email protected]:electron/libchromiumcontent.git
$ cd libchromiumcontent
$ ./script/bootstrap -v
Update the Chromium snapshot
VERSION
file with itcurl -so- https://omahaproxy.appspot.com/mac > VERSION
curl -so- https://omahaproxy.appspot.com/all | grep "win64,beta" | awk -F, 'NR==1{print $3}' > VERSION
$ ./script/update
Fix *.patch
files in the patches/
and patches-mas/
folders.
(Optional) script/update
applies patches, but if multiple tries are needed
you can manually run the same script that update
calls:
$ ./script/apply-patches
script/patch.py
that may be useful.
Read ./script/patch.py -h
for more information.Run the build when all patches can be applied without errors
$ ./script/build
When the build succeeds, create a dist
for Electron
$ ./script/create-dist --no_zip
dist/main
folder in the libcc repo's root.
You will need this to build Electron.(Optional) Update script contents if there are errors resulting from files
that were removed or renamed. (--no_zip
prevents script from create dist
archives. You don't need them.)
Get the code:
$ git clone [email protected]:electron/electron.git
$ cd electron
If you have libcc built on your machine in its own repo, tell Electron to use it:
$ ./script/bootstrap.py -v \
--libcc_source_path <libcc_folder>/src \
--libcc_shared_library_path <libcc_folder>/shared_library \
--libcc_static_library_path <libcc_folder>/static_library
If you haven't yet built libcc but it's already supposed to be upgraded
to a new Chromium, bootstrap Electron as usual
$ ./script/bootstrap.py -v
vendor/libchromiumcontent
) points to the
right revisionSet CLANG_REVISION
in script/update-clang.sh
to match the version
Chromium is using.
electron/libchromiumcontent/src/tools/clang/scripts/update.py
Checkout Chromium if you haven't already:
{VERSION}
placeholder in the url above to the Chromium
version libcc uses.)Build Electron.
$ ./script/build.py -c D
Fix compilation and linking errors
Ensure that Release build can be built too
$ ./script/build.py -c R
dist
Update ./script/create-dist
in the libcc repo, recreate a dist
, and
run Electron bootstrap script once again.
When a Debug build of Electron succeeds, run the tests:
$ npm run test
Fix the failing tests.
Follow all the steps above to fix Electron code on all supported platforms.
If there are any compilation errors related to the Crashpad, it probably means you need to update the fork to a newer revision. See Upgrading Crashpad for instructions on how to do that.
Upgrade vendor/node
to the Node release that corresponds to the v8 version
used in the new Chromium release. See the v8 versions in Node on
See Upgrading Node for instructions on this.
Electron ships with a version of ffmpeg
that includes proprietary codecs by
default. A version without these codecs is built and distributed with each
release as well. Each Chrome upgrade should verify that switching this version
is still supported.
You can verify Electron's support for multiple ffmpeg
builds by loading the
following page. It should work with the default ffmpeg
library distributed
with Electron and not work with the ffmpeg
library built without proprietary
codecs.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Proprietary Codec Check</title>
</head>
<body>
<p>Checking if Electron is using proprietary codecs by loading video from http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4</p>
<p id="outcome"></p>
<video style="display:none" src="http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4" autoplay></video>
<script>
const video = document.querySelector('video')
video.addEventListener('error', ({ target }) => {
if (target.error.code === target.error.MEDIA_ERR_SRC_NOT_SUPPORTED) {
document.querySelector('#outcome').textContent = 'Not using proprietary codecs, video emitted source not supported error event.'
} else {
document.querySelector('#outcome').textContent = `Unexpected error: ${target.error.code}`
}
})
video.addEventListener('playing', () => {
document.querySelector('#outcome').textContent = 'Using proprietary codecs, video started playing.'
})
</script>
</body>
</html>