• Stars
    star
    17,623
  • Rank 1,521 (Top 0.04 %)
  • Language
    JavaScript
  • License
    Mozilla Public Li...
  • Created almost 7 years ago
  • Updated 9 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Brave browser for Android, iOS, Linux, macOS, Windows.

Brave Browser

Overview

This repository holds the build tools needed to build the Brave desktop browser for macOS, Windows, and Linux. In particular, it fetches and syncs code from the projects defined in package.json and src/brave/DEPS:

Downloads

You can visit our website to get the latest stable release.

Contributing

Please see the contributing guidelines.

Our Wiki also has some useful technical information.

Community

Join the Q&A community if you'd like to get more involved with Brave. You can ask for help, discuss features you'd like to see, and a lot more. We'd love to have your help so that we can continue improving Brave.

Help us translate Brave to your language by submitting translations at https://explore.transifex.com/brave/brave_en/.

Follow @brave on Twitter for important news and announcements.

Install prerequisites

Follow the instructions for your platform:

Clone and initialize the repo

Once you have the prerequisites installed, you can get the code and initialize the build environment.

git clone [email protected]:brave/brave-core.git path-to-your-project-folder/src/brave
cd path-to-your-project-folder/src/brave
npm install

# the Chromium source is downloaded, which has a large history (gigabytes of data)
# this might take really long to finish depending on internet speed

npm run init

brave-core based android builds should use npm run init -- --target_os=android --target_arch=arm (or whichever CPU type you want to build for) brave-core based iOS builds should use npm run init -- --target_os=ios

You can also set the target_os and target_arch for init and build using:

npm config set target_os android
npm config set target_arch arm

Additional parameters needed to build are documented at https://github.com/brave/brave-browser/wiki/Build-configuration

Internal developers can find more information at https://github.com/brave/devops/wiki/%60.env%60-config-for-Brave-Developers

Build Brave

The default build type is component.

# start the component build compile
npm run build

To do a release build:

# start the release compile
npm run build Release

brave-core based android builds should use npm run build -- --target_os=android --target_arch=arm or set the npm config variables as specified above for init

brave-core based iOS builds should use the Xcode project found in ios/brave-ios/App. You can open this project directly or run npm run ios_bootstrap -- --open_xcodeproj to have it opened in Xcode. See the iOS Developer Environment for more information on iOS builds.

Build Configurations

Running a release build with npm run build Release can be very slow and use a lot of RAM, especially on Linux with the Gold LLVM plugin.

To run a statically linked build (takes longer to build, but starts faster):

npm run build -- Static

To run a debug build (Component build with is_debug=true):

npm run build -- Debug

NOTE: the build will take a while to complete. Depending on your processor and memory, it could potentially take a few hours.

Run Brave

To start the build:

npm start [Release|Component|Static|Debug]

Update Brave

npm run sync -- [--force] [--init] [--create] [brave_core_ref]

This will attempt to stash your local changes in brave-core, but it's safer to commit local changes before running this

npm run sync will (depending on the below flags):

  1. πŸ“₯ Update sub-projects (chromium, brave-core) to latest commit of a git ref (e.g. tag or branch)
  2. πŸ€• Apply patches
  3. πŸ”„ Update gclient DEPS dependencies
  4. ⏩ Run hooks (e.g. to perform npm install on child projects)
flag Description
[no flags] updates chromium if needed and re-applies patches. If the chromium version did not change, it will only re-apply patches that have changed. Will update child dependencies only if any project needed updating during this script run.
**Use this if you want the script to manage keeping you up to date instead of pulling or switching branches manually. **
--force updates both Chromium and brave-core to the latest remote commit for the current brave-core branch and the Chromium ref specified in brave-browser/package.json (e.g. master or 74.0.0.103). Will re-apply all patches. Will force update all child dependencies.
**Use this if you're having trouble and want to force the branches back to a known state. **
--init force update both Chromium and brave-core to the versions specified in brave-browser/package.json and force updates all dependent repos - same as npm run init
--sync_chromium (true/false) Will force or skip the chromium version update when applicable. Useful if you want to avoid a minor update when not ready for the larger build time a chromium update may result in. A warning will be output about the current code state expecting a different chromium version. Your build may fail as a result.
-D, --delete_unused_deps Will delete from the working copy any dependencies that have been removed since the last sync. Mimics gclient sync -D.

Run npm run sync brave_core_ref to checkout the specified brave-core ref and update all dependent repos including chromium if needed.

Scenarios

Create a new branch:

brave-browser> cd src/brave
brave-browser/src/brave> git checkout -b branch_name

Checkout an existing branch or tag:

brave-browser/src/brave> git fetch origin
brave-browser/src/brave> git checkout [-b] branch_name
brave-browser/src/brave> npm run sync
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

Update the current branch to the latest remote:

brave-browser/src/brave> git pull
brave-browser/src/brave> npm run sync
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

Reset to latest brave-browser master and brave-core master (via init, will always result in a longer build and will remove any pending changes in your brave-core working directory):

brave-browser> git checkout master
brave-browser> git pull
brave-browser> npm run sync -- --init

When you know that DEPS didn't change, but .patch files did (quickest attempt to perform a mini-sync before a build):

brave-browser/src/brave> git checkout featureB
brave-browser/src/brave> git pull
brave-browser/src/brave> cd ../..
brave-browser> npm run apply_patches
...Applying 2 patches...

Enabling third-party APIs:

  1. Google Safe Browsing: Get an API key with SafeBrowsing API enabled from https://console.developers.google.com/. Update the GOOGLE_API_KEY environment variable with your key as per https://www.chromium.org/developers/how-tos/api-keys to enable Google SafeBrowsing.

Development

Troubleshooting

See Troubleshooting for solutions to common problems.

More Repositories

1

browser-laptop

[DEPRECATED] Please see https://github.com/brave/brave-browser for the current version of Brave
JavaScript
7,944
star
2

brave-core

Core engine for the Brave browser for mobile and desktop. For issues https://github.com/brave/brave-browser/issues
HTML
2,451
star
3

brave-ios

Brave iOS Browser
Swift
1,701
star
4

adblock-rust

Brave's Rust-based adblock engine
Rust
1,419
star
5

link-bubble

Brave Link Bubble Browser
Java
1,014
star
6

muon

[DEPRECATED] Build browsers and browser like applications with HTML, CSS, and JavaScript
C++
970
star
7

goggles-quickstart

Educational material to learn about Goggles and how to create your own.
579
star
8

brave-ui

List of reusable React components to empower your brave UI
TypeScript
475
star
9

adblock-lists

Maintains adblock lists that Brave uses
Adblock Filter List
332
star
10

sync

deprecated Brave sync server. (sync now uses a fork of the Chromium sync protocol.)
JavaScript
206
star
11

go-sync

Brave sync server v2
Go
185
star
12

brave-talk

Unlimited private video calls with your friends and colleagues
TypeScript
112
star
13

adblock-resources

Custom resources and scriptlets used for Brave's adblocker
JavaScript
68
star
14

tracking-protection

Tracking protection engine used in the Brave browser for list like disconnectme.
C++
63
star
15

sta-rs

Rust
55
star
16

ledger

Deprecated, please see
JavaScript
53
star
17

web-discovery-project

Web Discovery Project
JavaScript
50
star
18

ethereum-remote-client

Integrated customization of MetaMask for use in Brave
JavaScript
49
star
19

news-aggregator

Python
48
star
20

adblock-rust-ffi

An FFI crate to expose functionality from brave/adblock-rust
Rust
46
star
21

leo

Design tokens for the Brave's design system known as Leo
Svelte
45
star
22

brave-extension

Shields panel browser action extension for the Brave browser
TypeScript
43
star
23

brave-core-crx-packager

JavaScript
40
star
24

kuchikiki

(口利き) HTML tree-manipulation library for Rust
Rust
34
star
25

go-translate

Translation adapter / relay server for Brave
Go
32
star
26

brave-wallet-docs

Documentation for the Brave Wallet docs site
JavaScript
31
star
27

brave-site-specific-scripts

a.k.a. Greaselion
TypeScript
31
star
28

crypto

shared crypto utils for Brave Browser
JavaScript
28
star
29

go-update

Component update server for brave-core written in Go
Go
28
star
30

nitriding-daemon

Tool kit for building secure, scalable, and networked services on top of AWS Nitro Enclaves.
Go
26
star
31

ads-ui

Self-service ads UI
TypeScript
23
star
32

muon-quick

JavaScript
22
star
33

qa-resources

HTML
21
star
34

omaha

Omaha for brave-browser
C++
20
star
35

token-lists

Manages custom token lists for Brave Wallet
JavaScript
20
star
36

tor_build_scripts

Build scripts for tor binary
Shell
20
star
37

brave-talk-gcalendar-extension

A Chrome extension for Calendar integrations for Brave Talk
TypeScript
20
star
38

source-suggestions

Python
19
star
39

viproxy

Go TCP proxy library that translates between AF_INET and AF_VSOCK.
Go
19
star
40

vault-updater

Laptop browser update service
JavaScript
19
star
41

brave-variations

Resources to compile, publish and inspect the variations seed file
TypeScript
19
star
42

zerotrace

Go package that provides an implementation of the 0trace traceroute technique to determine the round trip time to a remote client.
Go
19
star
43

nitriding

Tool kit for building networked services on top of AWS Nitro Enclaves.
Go
19
star
44

vault

Brave personal data store vault.
JavaScript
19
star
45

pull-merge

LLM Capabilities for your pull-requests
JavaScript
18
star
46

https-everywhere-builder

Build HTTPS Everywhere ruleset files for Brave
JavaScript
17
star
47

security-action

Composite GitHub CI Action containing the minimal viable security lint for brave repositories
JavaScript
17
star
48

tokenizer

A modular resource tokenization service.
Go
16
star
49

pagegraph-crawl

Gather pagegraph data from all over the internet
JavaScript
16
star
50

referrer-whitelist

15
star
51

bat-community-website

Official BAT Community website.
HTML
14
star
52

wallet-standard-brave

TypeScript
14
star
53

brave-release

Project to build packages that install repos and keyrings
Shell
13
star
54

swap

Brave Swap monorepo
TypeScript
12
star
55

brave-rewards-ios

Brave Rewards UI & Implementation on iOS
Swift
11
star
56

store-brave-com

TypeScript
10
star
57

brave-chromium-themes

Brave Themes
9
star
58

slim-list-lambda

Lambda function for reducing EasyList + EasyPrivacy for use in iOS clients
JavaScript
9
star
59

autoplay-whitelist

C++
9
star
60

extension-whitelist

C++
9
star
61

devops-github-workflows

9
star
62

https-everywhere-lib-cpp

C++ FFI bindings to the EFF HTTPS Everywhere library
Rust
9
star
63

simplepadding

Python
8
star
64

browser-laptop-releases

Published releases for brave/browser-electron used by brave/electron-prebuilt
HTML
8
star
65

ads-manager-landing-page

HTML
8
star
66

ledger-publisher

Deprecated, please see
JavaScript
8
star
67

constellation-processors

Server-side collector and aggregator for recovering data protected by the Constellation/nested STAR protocol.
Rust
7
star
68

muon-winstaller

Creates windows installers for Brave (forked originally from electron-winstaller
JavaScript
7
star
69

nlp-pipelines

NLP pipelines for in-browser functionality
Jupyter Notebook
7
star
70

star-randsrv

Go wrapper service for the STAR randomness server.
Rust
7
star
71

scproxy

Multi tiered redis proxy hack for sccache (wip)
Go
6
star
72

sdebug

a wrapper around debug() to add structured data logging
JavaScript
6
star
73

brave-ad-service

Documentation and Specs related to the Brave Ad Service
6
star
74

install-cmake

Download and compile CMake for subsequent use by npm installations
JavaScript
5
star
75

bitgo-client

JavaScript
5
star
76

sugarcoat-pipeline

CLI that implements the SugarCoat pipeline
JavaScript
5
star
77

omaha-build

[WIP] Windows omaha client
PowerShell
5
star
78

user-studies-extension

JavaScript
5
star
79

git-secrets-unittest

Python
5
star
80

svg-resizer

JavaScript
5
star
81

transparency-report-generator

TypeScript
5
star
82

release-tools

Release tools for browser-laptop and extensions
JavaScript
5
star
83

php-coding-standards

PHP Coding Standards for Brave.com
5
star
84

webkit-cpu-profiler-tools

WebKit CPU Profile tools
JavaScript
5
star
85

ledger-client

Deprecated, please see
JavaScript
5
star
86

ad-block-visualize

Tools to help visualize ad-block list data.
JavaScript
5
star
87

constellation

Rust
5
star
88

site-hacks-extension

Experiment moving the site hacks into an extension for use in Brave
JavaScript
5
star
89

node-anonize2-relic-emscripten

Node bindings to the anonize2 library, using the RELIC toolkit and Emscripten.
C
5
star
90

go-sync-adm-tools

Go
5
star
91

ledger-geoip

Find the geoip information for an IP address, do so using a list of geoip reporters that is weighted over time.
JavaScript
5
star
92

playlist-component

JavaScript
4
star
93

ledger-balance

Deprecated, please see
JavaScript
4
star
94

mixpanel-android

Java
4
star
95

link-bubble-website

http://linkbubble.com
HTML
4
star
96

debug-symbol-fetcher

This repository fetches debug symbols for brave browser builds
Shell
4
star
97

brave-tipping-extension

4
star
98

httpse2ios

Converts HTTPSE xml rules to iOS Content Blocking API format
JavaScript
4
star
99

https-everywhere-ruleset

Fork of the last freely-licensed copy of the EFF HTTPS Everywhere ruleset
4
star
100

node-anonize2-relic

Node bindings to the anonize2 library, using the RELIC toolkit.
C
4
star