Giter Site home page Giter Site logo

brave / brave-browser Goto Github PK

View Code? Open in Web Editor NEW
16.7K 382.0 2.1K 25.29 MB

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

Home Page: https://brave.com

License: Mozilla Public License 2.0

JavaScript 100.00%
brave browser chromium linux windows macos

brave-browser's Introduction

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.

brave-browser's People

Contributors

alexeybarabash avatar antonok-edm avatar bbondy avatar brave-browser-releases avatar brave-builds avatar bridiver avatar bsclifton avatar darkdh avatar diracdeltas avatar emerick avatar fmarier avatar garrettr avatar jumde avatar kjozwiak avatar kylehickinson avatar laurenwags avatar linhkikuchi avatar mariospr avatar mbacchi avatar mihaiplesa avatar mkarolin avatar nejczdovc avatar petemill avatar ryanjarv avatar samartnik avatar sergeyzhukovsky avatar simonhong avatar srirambv avatar wknapik avatar yrliou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

brave-browser's Issues

Fix confusing content settings names

We currently use 'allow' for content setting of ad-block which is confusing because you're allowing the ad-block of ads.

Instead change to content settings name of 'ads' and allow or block them.

Also it's an issue if you toggle on and off in sequence for top level shields, it clears the saved previous values of the sub-shield settings. This needs to be stored separately.

Make Flash plan for the first release

Chrome's Flash deprecation policy is here:
https://www.chromium.org/flash-roadmap

As of C68 we'll have:

Non-Persisted HTML5 by Default (Target: Chrome 68 - July 2018)
Summary
Sites using Flash will require explicit permission to run, every time the user restarts the browser.
Rationale
Require affirmative user choice to run Flash Player content, without that choice persisting across multiple sessions.

For the initial version that is OK.

We can diverge from the Disable by default (Chrome 76+ - July 2019) and Remove Flash completely ( Dec 2020) in separate issues.

Tab pages

To keep in line with browser-laptop, all tab set options should be available

image

Add better download logic for DAT files

Currently it just downloads on each run.
It should use etags and conditionally download and check only on certain time intervals. See browser-laptop for reference.

Per-origin NoScript

  • The front end needs a way to get details of the JS resources which are blocked.
  • Finer grained control to pick which subresource origins to be temporarily allowed.

Tie into component updater

Use Brave component updater for extension installation which will offer extensions from Brave's server.

extensions.brave.com

We would like to have a page showcasing extensions which are installable in the Brave browser. Users could visit this page, find extensions they're interested in, and then install them

Milestones

  • Stand up a REST API around the store functionality. Used to fetch extension details
  • Create the minimum HTML/JavaScript needed for a client page to call the REST API and show the results (even just if in a div)
  • Get the client page using React (including Brave UI)
  • Update client page with JavaScript needed to install an extension (one of the extensions being listed)
  • If extensions are already installed, show a difference in the UI ("already installed")
  • Have a details page available for each extension. This would route to a different URL like /store/extension-id-here. We'd want to be storing enough information to make this useful (ex: instead of just extension id, name, version- we should pull more fields)
  • Componentize the UI code using React - use Brave UI where possible
  • Create unit tests for the REST API
  • Integrate a linter (ex: standard) with the project
  • Setup a git pre-push hook to ensure lint/tests pass before a push is done

Taking this to the next level

There are a few things we could do to make this experience better which are definitely related, but should be captured in different issues.

  • Updating extensions (perhaps by calling the REST API?)
  • Adding new extensions get added to the store
  • Vetting extensions for quality (ex: not malware, not making risky calls)
  • Management interface for extensions (for our use- ex: used to approve/reject extensions)

Support building with different channels w/ different branding

You can find icon resources here:
https://github.com/brave/muon/tree/master/app/resources

Anthony started things here, and apparently it works for macOS.
https://github.com/brave/brave-browser/tree/multi-channel
https://github.com/brave/brave-core/tree/multi-channel

So still remaining is Linux and Windows.

You can see where we have different profile directories for each OS here:
brave/brave-core#46
brave/brave-core#59
This doc might be helpful:
https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md

We want to support 4 channels:
release, beta, developer, and canary

User directory

For official build

  • ~/Library/Application Support/BraveSoftware/Brave-Browser-Dev/Default for dev channel
  • ~/Library/Application Support/BraveSoftware/Brave-Browser-Beta/Default for beta channel
  • ~/Library/Application Support/BraveSoftware/Brave-Browser-Canary/Default for canary channel
  • ~/Library/Application Support/BraveSoftware/Brave-Browser/Default for release channel

For unofficial build

  • ~/Library/Application Support/BraveSoftware/Brave-Browser-Development/Default for all channel

TODOs

  • channel option for build command (brave-browser)
  • user dir support (brave-core)
    • MacOS
    • Windows
    • Linux
  • install dir
    • MacOS
    • Windows
    • Linux
  • app icon (brave-core)
    • MacOS
    • Windows
    • Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.