brave / muon Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Build browsers and browser like applications with HTML, CSS, and JavaScript
Home Page: https://discord.gg/TcT5tX2
License: MIT License
[DEPRECATED] Build browsers and browser like applications with HTML, CSS, and JavaScript
Home Page: https://discord.gg/TcT5tX2
License: MIT License
making brave_password_manager_client a subclass of chrome_password_manager_client
/home/posi/brave/browser-laptop-bootstrap/src/out/Release/brave --user-data-dir=brave-development --enable-logging --v=0 /home/posi/brave/browser-laptop-bootstrap/src/browser-laptop
[26840:26840:1206/161323:ERROR:browser_main_parts.cc(173)] Could not set linux app data path
(node:26840) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
Crash reporting enabled
(node:26840) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
(node:26840) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
[26840:26840:1206/161326:ERROR:extension_function_dispatcher.cc(613)] Unknown Extension API - permissions.contains
[26840:26840:1206/161346:ERROR:CONSOLE(19)] "Uncaught TypeError: The first argument is the receiver and must be an object", source: extensions::SafeBuiltins (19)
[26840:26840:1206/161346:ERROR:CONSOLE(19)] "Uncaught TypeError: The first argument is the receiver and must be an object", source: extensions::SafeBuiltins (19)
[26840:26840:1206/161353:ERROR:CONSOLE(19)] "Uncaught TypeError: The first argument is the receiver and must be an object", source: extensions::SafeBuiltins (19)
[26840:26840:1206/161353:ERROR:CONSOLE(19)] "Uncaught TypeError: The first argument is the receiver and must be an object", source: extensions::SafeBuiltins (19)
WARNING: requesting non-HTTPS URL http://johnkalberer.com/favicon.ico
There is a problem with the Buffer library export/require. This results in the following error:
Uncaught TypeError: Cannot read property 'from' of undefined
at metaToValue (extensions::remote:209)
at remoteMemberFunction (extensions::remote:113)
I try to add proxy support for browser-laptop, I use webContents.session.setProxy to set socks5 proxy, the proxy is setup using ssh tunnel. The proxy works as expected to load web pages, but the DNS requests do not get proxied.
I did the same thing with electron v1.4.13, both the web requests and DNS requests are proxied. Is this a problem with Muon?
The code is as below:
BrowserWindow.getAllWindows().forEach((wnd) =>
wnd.webContents.session.setProxy({proxyRules:"socks5://127.0.0.1:1080",proxyBypassRules:"localhost"}, function () {
console.log("proxy enabled....");
}))
Follow-up of
#70 (comment)
Brave: 0.13.2
rev: 25b1199fb6154b089cbad37926483239495b9800
Muon: 2.0.19
libchromiumcontent: 54.0.2840.100
V8: 5.4.500.41
Node.js: 7.0.0
Update Channel: dev
os.platform: win32
os.release: 10.0.14393
os.arch: x64
The chrome://chrome-urls have been extremely useful for debugging QUIC and other protocols, and could potentially be of use for benchmarking (we can export json log files, and record json captures for sessions w/in different URLs in this set).
Graphs are available, etc. Lots of good stuff.
Particularly useful for QUIC debugging and other protocol issues that aren't clearly visible/present within DevTools.
@bridiver this appears to be present w/in the Chromium code here:
https://cs.chromium.org/chromium/src/chrome/common/url_constants.h?type=cs&q=chrome-urls&l=519
// Gets the hosts/domains that are shown in chrome://chrome-urls.
extern const char* const kChromeHostURLs[];
extern const size_t kNumberOfChromeHostURLs;
// "Debug" pages which are dangerous and not for general consumption.
extern const char* const kChromeDebugURLs[];
extern const int kNumberOfChromeDebugURLs;
// The chrome-native: scheme is used show pages rendered with platform specific
// widgets instead of using HTML.
extern const char kChromeNativeScheme[];
Lines 519-529 in the code for ref.
Brave: 0.12.13
Muon: 1.4.30
libchromiumcontent: 53.0.2785.143
V8: 5.3.332.47
Node.js: 6.5.0
Update Channel: dev
os.platform: win32
os.release: 10.0.14393
os.arch: x64
Reproduction Steps:
%appdata%\Roaming\brave\Extensions\hdokiejnpimakedhajhdlcegeplioahd
icon2.png
to icon2.png_
.Alternative Steps:
%appdata%\Roaming\brave\Extensions\hdokiejnpimakedhajhdlcegeplioahd
"16": "icon2.png",
from manifest.json
and saveWhen trying to run browser-laptop
, I am getting output like so:
C:\GitHub\browser-laptop-bootstrap\src\out\Release\brave.exe --user-data-dir=brave-development --enable-logging --v=0 C:\GitHub\browser-laptop-bootstrap\src\browser-laptop
(node:5364) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
Crash reporting enabled
An uncaught exception occurred in the main process Uncaught Exception:
Error: Failed to get path
at getPepperFlashPath (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\flash.js:24:16)
at Object.module.exports.checkFlashInstalled (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\flash.js:90:39)
at Object.module.exports.init (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\flash.js:116:18)
at flashReducer (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\app\browser\reducers\flashReducer.js:15:13)
at handleAppAction (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\stores\appStore.js:366:14)
at C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\dispatcher\appDispatcher.js:67:23
at Array.forEach (native)
at AppDispatcher.dispatch (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\dispatcher\appDispatcher.js:64:20)
at Object.setState (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\js\actions\appActions.js:17:19)
at loadAppStatePromise.then (C:\GitHub\browser-laptop-bootstrap\src\browser-laptop\app\index.js:409:16)
My guess is that my older existing profile doesn't have the value required that is being searched for
Temporary work-around for me was to comment out the flashReducer in js/stores/appStore.js
(inside handleAppAction).
cc @bridiver
crash reports from the renderer process are missing version and process type
In Tofino we register a tofino:// protocol handler through the protocol.registerHttpProtocol electron API. This works in regular Electron but crashes with a segmentation fault in current builds of brave/electron
.
Extension::Load
should post the file read to the file thread
https://github.com/electron/brightray/blob/master/browser/browser_main_parts.cc#L83 this no longer works. In particular PathService::Get(DIR_APP_DATA, &path) returns an empty path if used.
Before removing we should look into if this is needed in Chromium though. I haven't checked so I'm not sure if DIR_APP_DATA is set later or not by Chromium, and maybe Chromium expects to have a value for it.
I believe this is why the debug build fails
This says for webPreferences
nodeIntegration Boolean - Whether node integration is enabled. Default is true.
Is "Default is true" part hasn't been changed since forking from an electron, or, is this is a correct depiction of muon current api?
Thank you.
I'm interested in taking a look at Muon. As outlined in the docs, I've started with the muon-quick
project. However, It looks like the Node APIs are available within the renderer. See the changes here:
ColinEberhardt/muon-quick@6357860
I thought that muon removed node integration? Is this something I have to explicitly enable?
(I also spotted a few issues in the muon-quick
project, e.g. the dependencies wouldn't install, and some left-over documentation from electron. I'd be happy to submit a PR with some tidy up)
Following directions for cloning electron git clone https://github.com/brave/electron and then trying to execute either:
npm run bootstrap
or
python .\script\bootstrap.py -v -target_arch=x64
both result in errors, different ones.
Trying to bootstrap from npm after cd electron produces.
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'bootstrap' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebootstrap', 'bootstrap', 'postbootstrap' ]
5 info lifecycle [email protected]~prebootstrap: [email protected]
6 silly lifecycle [email protected]~prebootstrap: no script for prebootstrap, continuing
7 info lifecycle [email protected]~bootstrap: [email protected]
8 verbose lifecycle [email protected]~bootstrap: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~bootstrap: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;C:\MirageID\electron\node_modules\.bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI\wbin;C:\Program Files\nodejs\;C:\Users\MatthewSeagle\AppData\Local\Microsoft\WindowsApps;C:\Users\MatthewSeagle\AppData\Local\atom\bin;C:\depottools;C:\Python27;C:\Program Files\nodejs\;C:\Users\MatthewSeagle\AppData\Roaming\npm
10 verbose lifecycle [email protected]~bootstrap: CWD: C:\MirageID\electron
11 silly lifecycle [email protected]~bootstrap: Args: [ '/d /s /c', 'python ./script/bootstrap.py' ]
12 silly lifecycle [email protected]~bootstrap: Returned: code: 1 signal: null
13 info lifecycle [email protected]~bootstrap: Failed to exec bootstrap script
14 verbose stack Error: [email protected] bootstrap: `python ./script/bootstrap.py`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:885:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd C:\MirageID\electron
17 error Windows_NT 10.0.14393
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "bootstrap"
19 error node v7.2.1
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] bootstrap: `python ./script/bootstrap.py`
22 error Exit status 1
23 error Failed at the [email protected] bootstrap script 'python ./script/bootstrap.py'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the electron package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error python ./script/bootstrap.py
23 error You can get information on how to open an issue for this project with:
23 error npm bugs electron
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls electron
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
The error that seems more significant almost is before the debug log is output comes from windows and it states it cannot find a file in vendor\requests
> [email protected] bootstrap C:\MirageID\electron
> python ./script/bootstrap.py
Traceback (most recent call last):
File "./script/bootstrap.py", line 79, in <module>
sys.exit(main())
File "./script/bootstrap.py", line 32, in main
setup_python_libs()
File "./script/bootstrap.py", line 59, in setup_python_libs
with scoped_cwd(os.path.join(VENDOR_DIR, lib)):
File "C:\depottools\python276_bin\lib\contextlib.py", line 17, in __enter__
return self.gen.next()
File "C:\MirageID\electron\script\lib\util.py", line 56, in scoped_cwd
os.chdir(path)
WindowsError: [Error 2] The system cannot find the file specified: 'C:\\MirageID\\electron\\vendor\\requests'
If I try to run bootstrap from the script dir using python python .\script\bootstrap.py -v -target_arch=x64 it gives me an error relating bootstrap.py unrecognized arguments --target_arch=x64
any reason why a month ago this built fine and now it won't? Updates? Documentation for clean build not updated? I'm able to build brave fine.
The strange date behavior in the tab isn't as a result of incorrect ICU configuration. Rather this behavior can always be simulated while using the packages vs npm run start. Closer examination shows that we are missing javascript from the electron build. It's getting included by happenstance when one does npm run start.
I originally thought that ICU full wasn't being properly enabled this doesn't seem to be the cause of this error.
There are two ways to talk to a window: ipc and remote, which is full rmi (even if created on top of ipc).
.remote
, being an all inclusive rmi is not save.
So, is it available in muon's preload, or not?
Is ipc, being less dangerous, available, or not?
Thank you
PS docs are verbatim of electron's, thus, do not shed any light :(
for now it is Build cross platform desktop apps with web technologies http://electron.atom.io
Is there support for a webview on desktop and mobile envisaged ?
I know this is a very open question but it would be really great to get an answer on this.
Great project btw. Brave and the bitcoin payment model is what the internet needs !
In reference to 62dec3b
content/browser/renderer_host/render_widget_host_view_mac.mm
In showLookUpDictionaryOverlayFromRange
(from ShowDefinitionForSelection
)
gfx::Rect root_box = renderWidgetHostView_->GetViewBounds();
will get 0,0 0x0
comparing to showLookUpDictionaryOverlayAtPoint
(from three finger tapping)
will get 0,22 1440x838
from the same selected word.
Set the language setting automatically. This should be implemented by brave-laptop 1.0 I think.
brave/browser-laptop#4351 (comment)
BrianJ recommends we get this from the electron side and that base/win/i18n has a more reliable way.
Found in browser-laptop that changing tabs causes a lot (at least 1 per open tab) of chrome-tabs-updated
messages with the same changeInfo {"mutedInfo":{"muted":false,"reason":"user"}}
. It doesn't seem like a legit change.
Brave 0.15.312
rev aad836f
Muon 3.0.202
libchromiumcontent 58.0.3029.110
V8 5.8.283.38
Node.js 7.9.0
Update Channel dev
os.platform darwin
os.release 15.6.0
os.arch x64
The current example code has incorrect information, such as:
"All of the Node.js APIs are available in this renderer process."
This incorrect information should be replaced with pointers to chrome://brave
and ipcRenderer documentation.
I was able to use session.setProxy for electron before now that I am on muon I can't get the webContents portion that let me get the session before, any explanation or explanation of a fix would be greatly appreciated.
Hey.
Since the script/build.py
script was removed the build scripts recommended in documentation and existing issues no longer work:
npm run build
(see package.json L31)npm run browser-build
(see package.json L46)Existing docs use these and so are also out of date, see docs/development/build-instructions*.md
(e.g. build-instructions-linux.md).
Before this these were working great. Thanks!
Debug builds fail at the linking stage with this error:
brave_lib.lib(brave_lib.profile_writer.obj) : error LNK2019: unresolved external symbol "public: __cdecl TemplateURL::~TemplateURL(void)" (??1TemplateURL@@QEAA@XZ) referenced in function "public: void * __cdecl TemplateURL::`scalar deleting destructor'(unsigned int)" (??_GTemplateURL@@QEAAPEAXI@Z)
brave.exe : fatal error LNK1120: 1 unresolved externals
Looks related to the importer code that was added in #57
We currently new a instance of this base class. It will cause a crash from Debug build
- (void)sheetDidEnd:(NSWindow*)parent
returnCode:(NSInteger)returnCode
context:(void*)context {
NOTREACHED(); // Subclasses must implement this.
}
in chrome/browser/ui/certificate_viewer_mac.mm
reference
chrome/browser/ui/cocoa/certificate_viewer_mac_cocoa.h and chrome/browser/ui/cocoa/certificate_viewer_mac_cocoa.mm
"electron-builder": "^17.1.1"
When a background page of a browser extension is running and a call to chrome.runtime.getPlatformInfo(o => console.dir(o));
is made, the following is outputted to:
Chrome:
{
"arch": "x86-64",
"nacl_arch": "x86-64",
"os": "mac"
}
Chromium in Muon:
{
"arch": "",
"nacl_arch": "",
"os": ""
}
Maybe this is Chromium, or perhaps only Chromium in Muon. Is this because Chromium doesn’t support the full browser extension API, only Chrome? Just speculating here.
Examples of a polyfill if necessary
https://raw.githubusercontent.com/Rob--W/crxviewer/master/src/chrome-platform-info.js …
This can cause errors when a browser extension requires this information. This came about because I am trying to integrate the True Key Chrome extension, but it requires this information.
removed by brave/browser-laptop@5dedd3a
which was originally brave/browser-laptop@b82d6d385
from slack
browserActionUpdated should and currently is only called in response chrome-browser-action-* events
browserActionUpdated extension action isn’t being used and should be removed
if we need to clear the state on navigation that should happen in extensions.js
Using the node spellcheck provider in browser-laptop causes a lot of performance issues
i have gotten some questions from devs about whether they should use Muon instead of Electron. we should document the reasons to do so (and how to do it) somewhere, maybe a wiki page.
this is especially of interest to developers migrating off of Chrome Apps, which will be deprecated within a year. https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html
related: #87
the webcontents clone method copies the history, but doesn't copy other tab values. audioMuted
appears to be the only one that is relevant right now
#109 protects the apis from the main world, but if we opened up extensions and allowed installs from the chrome webstore a malicious extension could exploit similar vulnerabilities. We should audit and update all of the extension code to ensure that it uses safe versions of all at-risk methods (safe builtins)
Need to run some tests with QUIC in Brave, but currently this requires building muon to enable/disable.
Location in muon:
Requesting a command line option to enable or disable quic.
@bridiver if you'd prefer me to open this in brave/browser-laptop, lmk and I can open there instead.
All js should run in an isolated world to protect internal functions from scripts running in the page content. Any js that is exposed to the main world should use safe builtins
Hiya — working on app, switching from Electron to Muon. Tried the muon-quick repo. Found that windows weren't respecting Electron's optional level argument that you can pass to setAlwaysOnTop
Wondered if maybe the Quick Start repo was just pulling an old build, so naively tried swapping the Brave.app in electron-prebuilt/dist with a newer one (2.0.19.0) but now seems that transparency has stopped working as well (relativeLevel still seems to be ignored).
Any help would be appreciated! Also are there links for invites for the Muon related Slacks? Lmk / thanks!
Nativefier is a utility in the vein of Fluid or Mozilla's defunct Prism that uses Electron to create site-specific browsers. They're isolated from each other in terms of cookies, storage, etc. and lack the usual browser chrome.
I tried to briefly touch on some of the security challenges of using Electron in a browser-like capacity in nativefier/nativefier#288 -- challenges I'm sure the Brave team is familiar with. Would your fork of electron-prebuilt
potentially be usable as a drop-in for Nativefier's use case?
Inherited from electron...
-Wno-overloaded-virtual shouldn't be used, we should be specifying override when we override always for safety.
To make things less confusing:
brightray/browser/browser_client.h
Rename BrowserClient to BrightrayContentBrowserClient
atom/browser/atom_browser_client.h
Rename AtomBrowserClient to AtomContentBrowserClient
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.