Git Product home page Git Product logo

brave / browser-laptop Goto Github PK

View Code? Open in Web Editor NEW
8.0K 420.0 977.0 386.81 MB

[DEPRECATED] Please see https://github.com/brave/brave-browser for the current version of Brave

Home Page: https://www.brave.com

License: Other

JavaScript 94.99% CSS 2.21% HTML 0.43% Smarty 0.06% Ruby 0.07% Shell 0.20% NSIS 1.55% Python 0.40% PowerShell 0.10%
brave browser muon electron javascript linux windows macos bat

browser-laptop's Introduction

Lint Unit Tests codecov.io JavaScript Style Guide Open Source Helpers

Brave Browser

Desktop browser for macOS, Windows, and Linux.

Deprecation notice: this repository is for the older Muon (our fork of Electron) version of Brave.
The newer version of the browser (brave-core) can be found here.
Development is being wound down on this version as issues are migrated to the new code-base

If you're experiencing issues with Brave or would like to contribute, please check out the new code-base instead

For other versions of our browser, please see:

Downloads

To download the latest release, see our releases page.

You can also visit our website to get the latest stable release (along with a more user-friendly download page).

The Muon version of Brave has only one active release channel: Release. This will be deprecated as we move to brave-core. Both the Beta channel and Developer channel are already using the brave-core code-base.

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.

Useful documentation

Running from source

If you're setting up using Windows, please see the Building on Windows wiki entry for a full walkthrough.

For other platforms (macOS, Linux) You'll need certain packages installed before you can build and run Brave locally.

Prerequisites

  1. the current LTS version of nodejs

    Install from your package manager, nvm, or download from https://nodejs.org

  2. npm version 5 or greater (to make use of the package-lock.json)

On Debian / Ubuntu /Mint

apt-get install build-essential rpm ninja-build

On Fedora

dnf install rpm-build
dnf group install "Development Tools" "C Development Tools and Libraries"

Installation

After installing the prerequisites:

  1. Clone the git repository from GitHub:

     # For beta testers:
     git clone --depth 1 https://github.com/brave/browser-laptop
    
     # For devs over HTTPS:
     git clone https://github.com/brave/browser-laptop
    
     # For devs over SSH:
     git clone [email protected]:brave/browser-laptop.git
    
  2. Open the working directory:

     cd browser-laptop
    
  3. Install the Node dependencies:

     npm install
    

Instead of npm install you may also install with yarn running yarn install.

Troubleshooting

Additional notes on troubleshooting installation issues are in the Troubleshooting page in the Wiki.

Preconfigured VMs

Some platforms are available as pre-configured VMs. See the readme for details.

Running Brave

To run a development version of the browser requires a few steps. The easiest way is just to use two terminals. One terminal can be used just to watch for changes to the code

npm run watch

Now actually run Brave in another terminal

npm start

Some errors related to brave/electron update can be fixed by doing a clean install:

rm -rf node_modules/
npm install

If this does not work, please clear out your ~/.electron first and try again.

Running webdriver tests

To run the webdriver tests

npm run watch-test  or  npm run watch-all

Now run tests in another terminal

npm test

See docs/tests.md for more information.

Port

Brave uses port 8080 to communicate between its client and server sides by default. If you are using port 8080 for something else (e.g. a web proxy) then you can set the node config to make it use a different one.

e.g. npm config set brave:port 9001

Additional notes on troubleshooting development issues are in the Troubleshooting page in the Wiki.

Running inside of a development version of Muon

By default, we provide pre-built binaries when you npm install with our own fork of electron-prebuilt.

If you want to modify the code to Muon (Brave's Electron fork), then you'll need to build it. An example of why you might do that would be exposing a new event to the webview (from Muon).

To start this process, you'll want to check out our browser-laptop-bootstrap repo. From there, you can follow the steps in our wiki to get up and running.

Packaging for bundles, installers, and updates

Please see our wiki entry for more information about packaging.

browser-laptop's People

Contributors

aekeus avatar alexwykoff avatar ayumi avatar bbondy avatar bradleyrichter avatar bridiver avatar bsclifton avatar cezaraugusto avatar charbelrami avatar darkdh avatar dcposch avatar diracdeltas avatar empact avatar evq avatar feross avatar jkup avatar jonathansampson avatar kevingrandon avatar kjozwiak avatar luixxiul avatar mrose17 avatar nejczdovc avatar petemill avatar posix4e avatar psimyn avatar riastradh-brave avatar ryanml avatar srirambv avatar vrde avatar willy-b 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

browser-laptop's Issues

Consider having appStore in the main process

I wanted to open the discussion to see if it would be a good idea to store application state inside the top level process. I'm thinking it would be better but I'm a little bit concerned about a perf hit. I think it would be OK though.

Right now each browser window maintains its own appState. This issue is posted to discuss changing that.

appState would change to be at a top level a collection of browsers. Each would contain a collection of frames and pretty much everything that is there now.

It would also enable cross frame state like pinned sites to exist more easily.

Some of the main changes that would be needed:

  • The dispatcher would be changed to do IPC.
  • components could no longer access the read only view it has of appStore, and would work only off of passed up data.

CC @diracdeltas @bridiver @aekeus

"login with google" doesn't log you in

Login to Feedly.com using google never actually logs me in. I can access mail.google.com after the authentication through the feedly sign-on page, but I can't access Feedly itself. I haven't tried other sites that use google login

url bar updating breaks after a tab is closed

  1. open brave.com
  2. open a new tab and close it
  3. type google.com into the url bar for the original tab, press enter. the url bar is not updated during redirects and the autosuggest bar lingers.

Memory leak warning with more than 9 tabs

Steps to reproduce:

  1. Create 10 tabs
(node) warning: possible EventEmitter memory leak detected. 11 crashed listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:239:17)
    at EventEmitter.once (events.js:265:8)
    at createGuest (/Users/bjohnson/Documents/brave/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/lib/guest-view-manager.js:51:16)
    at EventEmitter.<anonymous> (/Users/bjohnson/Documents/brave/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/lib/guest-view-manager.js:167:66)
    at emitThree (events.js:97:13)
    at EventEmitter.emit (events.js:175:7)
    at EventEmitter.<anonymous> (/Users/bjohnson/Documents/brave/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/api/lib/web-contents.js:91:27)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

typing current url doesn't trigger refresh

Steps to reproduce:

  1. Enter google.com in the address bar, hit return and let the page load
  2. Re-type google.com in the address bar and hit return again
  3. Page does not refresh

On all other browsers this triggers a refresh of the page

Handle app state that grows over time

Some app state will grow over time and is not practical to update on every dispatch request. One way to handle it would be to update it through the actions/dispatcher, but only keep a timestamp/version number in the state itself

sites: version,
bookmarks: version

Each window can detect when its version is out-of-date and load the most recent version from async storage or similar

action chaining

We often call several actions in a row that change state. This seems rather inefficient and we should be able to chain them together to update several values in a single dispatcher call

electron does not provide a mechanism to determine if a window.open was initiated by the user

Most browsers block non-user initiated popups by default (with some notification and an option to allow), but electron does not appear to provide a mechanism to tell the different in the new-window event.

Looks like it should be a pretty simple change. We can probably add something to:

  # Make new windows requested by links behave like "window.open"
  @webContents.on '-new-window', (event, url, frameName) ->
    options = show: true, width: 800, height: 600
    ipcMain.emit 'ATOM_SHELL_GUEST_WINDOW_MANAGER_WINDOW_OPEN', event, url, frameName, options

from atom/browser/api/lib/browser-window.coffee from electron assuming that covers both direct clicks on window.open initiated from onClick events (both are typically allowed by default)

Tabs don't resize with window

Test plan

#6900 (comment)


Steps to reproduce:

  1. Open Brave and maximize it
  2. Keep creating tabs until you reach 6
  3. Tabs will finally resize for the window

Not sure what the correct behavior should be here with a fixed number of tabs. Currently they only expand to fit the window size when there are 6 in the tab group. Maybe they should always fit the window width and get smaller until they max out at 6? @bradleyrichter ?

local shortcuts don't initially work on new windows

Steps to reproduce:

  1. Start the Browser
  2. Create a second window
  3. Local shortcuts (urlbar focus, tab navigation, dev tools, etc...) don't work, but app shortcuts (new tab) do
  4. Switch back to the first window
  5. Switch back to the second window again
  6. Local shortcuts now work on the second window

escape doesn't clear address bar changes

Steps to reproduce:

  1. Enter google.com into the address bar and press return
  2. type 'blah' into the address bar
  3. press the escape key
  4. text box loses focus, but text remains

Desired behavior:
escape should close the search bar panel if open, clear 'blah' and restore google.com, but keep focus and select

clicking bookmark button throws error

Uncaught Exception:
TypeError: frameProps.get is not a function
    at Object.exports.getSiteUrlIndex.exports.addSite (/Users/yan/repos/browser-electron/js/state/siteUtil.js:49:57)
    at handleAppAction (/Users/yan/repos/browser-electron/js/stores/appStore.js:79:49)
    at EventEmitter.<anonymous> (/Users/yan/repos/browser-electron/js/stores/appStore.js:91:52)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)
    at EventEmitter.<anonymous> (/Users/yan/repos/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/api/lib/web-contents.js:91:27)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

Implement computedThemeColor

Implement computedThemeColor based on a page's favicon color.
Also add computedThemeColor to state documentation.

Add the ability to close developer tools via keyboard shortcut on macOS

After opening content dev tools, you can't use the local shortcut to close them again.
STR:

  1. Command+Option+I to open dev tools
  2. Command+Option+I to close dev tools

Expected results:
It closes even though the devtools window has focus

Actual results:
You need to focus back to the parent window first.

@bridiver maybe we need to register with localShortcut the devtools window?

memory leak warning when ~10+ tabs are open

When I open 10 or so tabs in the browser, I get this error repeatedly:

> [email protected] start /Users/yan/repos/browser-electron
> NODE_ENV=development electron . --debug=5858

(node) warning: possible EventEmitter memory leak detected. 11 crashed listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events.js:239:17)
    at EventEmitter.once (events.js:265:8)
    at createGuest (/Users/yan/repos/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/lib/guest-view-manager.js:51:16)
    at EventEmitter.<anonymous> (/Users/yan/repos/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/lib/guest-view-manager.js:167:66)
    at emitThree (events.js:97:13)
    at EventEmitter.emit (events.js:175:7)
    at EventEmitter.<anonymous> (/Users/yan/repos/browser-electron/node_modules/electron-prebuilt/dist/Electron.app/Contents/Resources/atom.asar/browser/api/lib/web-contents.js:85:27)
    at emitTwo (events.js:87:13)
    at EventEmitter.emit (events.js:172:7)

switching between two tabs with the same url doesn't update url

Steps to replicate:

  1. Open two tabs with google.com
  2. Type some random text in the address bar for one them
  3. Switch to the other tab
  4. text will remain in address bar

Behavior in Safari, Chrome and Firefox:

  • Switch to the other tab => updates address bar with tab url
  • Switch back => random text is preserved

window.prompt is not supported currently

Test plan

  1. Visit https://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt
  2. Click the Try it button on the right hand side
  3. Confirm prompt is shown; text should be selected
  4. Type Brave and click OK
  5. Confirm Hello Brave! How are you today? is shown
  6. Repeat steps 2 - 5, except press enter to submit instead of clicking OK
  7. Click the Try it button on the right hand side
  8. Click Cancel button
  9. Confirm User cancelled the prompt. is shown
  10. Repeat steps 8 and 9 except press escape instead of clicking Cancel

Original issue description

We can patch here:
https://github.com/atom/electron/blob/c4931bb2d12f5905cdf434ed6ff1a755ccad053f/atom/renderer/lib/override.coffee#L92

window.prompt

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.