Brave Browser

适用于 macOS、Windows、Linux 和 Android 的下一代 Brave 浏览器。(Next generation Brave browser for macOS, Windows, Linux, Android.)

Github stars Tracking Chart

Brave 浏览器

简介

该存储库包含为 macOS、Windows 和 Linux 构建 Brave 桌面浏览器所需的构建工具。特别是,它从我们在 package.json 和 src/brave/DEPS 中定义的项目中获取和同步代码:

  • Chromium
    • 通过 depot_tools 获取代码。
    • 为 Chromium 设置分支 (例如:65.0.3325.181)。
  • brave-core
    • 安装在 src/brave
    • 维护第三方 Chromium 代码的补丁。
  • ad-block
    • 安装在 src/brave/vendor/ad-block
    • 实现 Brave 的广告拦截引擎。
  • 跟踪保护
    • 安装在 src/brave/vendor/tracking-protection.
    • 实现 Brave 的跟踪保护引擎。

构建说明

查看 Brave Wiki

下载

您可以访问我们的网站以获得最新的稳定版本。

其他存储库

对于我们浏览器的其他版本,请参阅:

社区

如果您想更多地参与 Brave,请加入问答社区。您可以寻求帮助讨论您希望看到的功能,以及更多功能。我们很乐意得到您的帮助,以便我们能够继续改进勇敢。
通过https://www.transifex.com/brave/brave/提交翻译,帮助我们将Brave翻译成您的语言

在Twitter上关注@brave,获取重要新闻和公告。

Overview

Name With Ownerbrave/brave-browser
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
PlatformAndroid, iOS, Linux, Mac, Windows
License:Mozilla Public License 2.0
Release Count7952
Last Release Namev1.64.53 (Posted on 2024-02-07 16:20:41)
First Release Namev0.50.13 (Posted on )
Created At2017-11-09 23:44:38
Pushed At2024-02-07 17:32:12
Last Commit At2024-02-06 21:32:24
Stargazers Count16.3k
Watchers Count383
Fork Count2.2k
Commits Count7.9k
Has Issues Enabled
Issues Count33448
Issue Open Count6902
Pull Requests Count1806
Pull Requests Open Count1
Pull Requests Close Count270
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

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 we define in package.json and src/brave/DEPS:

Downloads

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

Other repositories

For other versions of our browser, please see:

Contributing

Please see the contributing guidelines

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://www.transifex.com/brave/brave/

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 git@github.com:brave/brave-browser.git
cd brave-browser
npm install

# this takes 30-45 minutes to run
# the Chromium source is downloaded which has a large history
npm run init

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

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

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

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

You may also want to try .

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 branch manually. **
--create when used with brave_core_ref it will create a branch if one does not already exist
--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

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-core> git checkout -b branch_name

or

brave-browser> npm run sync -- --create branch_name

Checkout an existing branch or tag

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

or

brave-browser> npm run sync --create branch_name
...Updating 2 patches...
...Updating child dependencies...
...Running hooks...

Update the current branch to latest remote

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

Reset to latest brave-browser master, brave-core master and chromium

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)

brave-core> git checkout featureB
brave-core> git pull
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.

Troubleshooting

See Troubleshooting for solutions to common problems.

To the top