* chore: add ability to log native deprecation warnings
* take std::string, handle conversion later
* address feedback from @ckerr's review
* simplify with feedback from zcbenz
This is useful for checking which processes are sandboxed on OS level.
Regarding creationTime, since the pid can be reused after a process dies, it is useful to use both the pid and the creationTime to uniquely identify a process.
Historically, we've been passing in all MessageBox parameters individually, which makes augmenting or improving MessageBox functionality challenging because to change or add even one argument requires a huge cascade of argument changes that leaves room for errors.
For other file dialog related APIs, we use a struct (DialogSettings), and so this PR takes a similar approach and refactors MessageBox parameters into a struct (MessageBoxSettings) which we then use to simplify argument passing and which will enable us to more quickly iterate and improve upon functionality in the future.
* Initial changes to use crashpad for windows
* Remove crashpad patch
* Report error when failed to connect pipe
* Allow crashpad to communicate with named pipe
* Add patch to make crashpad named pipe work
* Windows also needs crashReporter on main process
* Call SetUnhandledExceptionFilter in node process
Node can also use crash reporter.
* Do not treat node process as browser process
* No more need to manually start crash service
* Use base::StringPrintf for better readbility
* Print error when pipe name not available
* Make sure pipe name is updated
Note that the crashpad may be started after renderer process gets
created.
* Fix some tests
* Update node
* Exclude crashpad files on Linux and MAS
* Fix lint warning
* Remove unused checks
* kCrashpadPipeName is only available on Windows
* Fix uploadToServer tests
* Fix extra params tests
* Fix getCrashesDirectory tests
* Run crashReporter tests on CI
* Style fixes
* Update crashreporter docs
* Rename InitBreakpad to Init
* Add comment for process_type_.empty() and UTF16ToASCII to UTF16ToUTF8.
* Update build.gn include crashpad headers
* Address comment https://github.com/electron/electron/pull/18483#discussion_r290887898
* Avoid using api::WebContents
* Put kRunAsNode in atom_constants
* Remove duplicate settings on upload params
* Fix building on macOS
* Update description for crashpad_pid_check.patch
* Pipe data into HTTP protocol handlers
* Remove unused parameters
* Remove "sending request of http protocol urls" test
Sending request to "http://" in "file://" violates CORS rules and always
fail, before NetworkService somehow Chromium still sent a request even
though the request failed with CORS error, so the test passes while the
test is not valid. With NetworkService no request is sent at all and the
test jsut fails.
So this is an ancient invalid test, as sending http requests have been
fully covered in other tests, I am removing this test.
* refactor: bundle the browser and renderer process electron code
* Bundles browser/init and renderer/init
* Improves load performance of main process by ~40%
* Improves load performance of renderer process by ~30%
* Prevents users from importing our "requiring" our internal logic such
as ipc-main-internal. This makes those message buses safer as they are
less accessible, there is still some more work to be done though to lock
down those buses completely.
* The electron.asar file now only contains 2 files, as a future
improvement maybe we can use atom_natives to ship these two files
embedded in the binary
* This also removes our dependency on browserify which had some strange
edge cases that caused us to have to hack around require-order and
stopped us using certain ES6/7 features we should have been able to use
(async / await in some files in the sandboxed renderer init script)
TLDR: Things are faster and better :)
* fix: I really do not want to talk about it
* chore: add performance improvements from debugging
* fix: resolve the provided path so webpack thinks it is absolute
* chore: fixup per PR review
* fix: use webpacks ProvidePlugin to keep global, process and Buffer alive after deletion from global scope for use in internal code
* fix: bundle worker/init as well to make node-in-workers work
* chore: update wording as per feedback
* chore: make the timers hack work when yarn is not used
* fix: make IsProtocolHandled return true for builtin schemes
* fix: return ERR_NOT_IMPLEMENTED for wrong arg
* Initial work of AsarURLLoader
* Put normal file logics in AsarURLLoader
* Implement asar file reading
* Don't change URL for unpacked file
* Fix cpplint warning
* Parse stream protocol handler
* Pipe node stream to mojo
* Merge the parser for headers
* Add ToDict helper to simplify code
* Simplify dispatching logic
* Add an experimental API for returning any type of response
* Fix subscribing event
* URL loaders' lifetime is independent of the factory
* HandleError helper is no longer needed
* Rename "SendResponse" => "StartLoading" to follow naming conventions
* Delete when connection error happens
* Fix cpplint warning
This turns the AtomViewMsg_Offscreen message, which only called the global setter blink::WebView::SetUseExternalPopupMenus(false) to get Chrome to render popup menus in the renderer instead of externally on macOS, into a command-line renderer flag --offscreen which does the same thing, except at render thread startup time, which is where Chromium sets the flag: https://chromium.googlesource.com/chromium/src/+/refs/tags/75.0.3755.3/content/renderer/render_thread_impl.cc#728.
This was the last usage of RenderViewObserver in our codebase, so this PR also removes that class.
Previously, we were creating the app logs folder at a predefined location during initial electron startup, which meant that it had to be manually removed and prevented clean app portability. This refactors that implementation such that it's now an opt-in feature and developers must call app.setAppLogsPath(path) with an optional custom path in order to set this directory.
* refactor: use mojo for electron internal IPC
* add sender_id, drop MessageSync
* remove usages of AtomFrameMsg_Message
* iwyu
* first draft of renderer->browser direction
* refactor to reuse a single ipc interface
* implement TakeHeapSnapshot through mojo
* the rest of the owl^WtakeHeapSnapshot mojofication
* remove no-op overrides in AtomRendererClient
* delete renderer-side ElectronApiServiceImpl when its pipe is destroyed
* looks like we don't need to overlay the renderer manifest after all
* don't try to send 2 replies to a sync rpc
* undo changes to manifests.cc
* unify sandboxed + unsandboxed ipc events
* lint
* register ElectronBrowser mojo service on devtools WebContents
* fix takeHeapSnapshopt failure paths
* {electron_api => atom}::mojom
* add send_to_all to ElectronRenderer::Message
* keep interface alive until callback is called
* review comments
* use GetContext from RendererClientBase
* robustify a test that uses window.open
* MessageSync posts a task to put sync messages in the same queue as async ones
* add v8::MicrotasksScope and node::CallbackScope
* iwyu
* use weakptr to api::WebContents instead of Unretained
* make MessageSync an asynchronous message & use non-associated interface
* iwyu + comments
* remove unused WeakPtrFactory
* inline OnRendererMessage[Sync]
* cleanups & comments
* use helper methods instead of inline lambdas
* remove unneeded async in test
* add mojo to manifests deps
* add gn check for //electron/manifests and mojo
* don't register renderer side service until preload has been run
* update gn check targets list
* move interface registration back to RenderFrameCreated
* refactor: Port inspector to TypeScript
* refactor: Add another type to inspector
* refactor: Use correct paths
* Update lib/renderer/inspector.ts
Co-Authored-By: felixrieseberg <felix@felixrieseberg.com>
* refactor: Implement feedback <3
* refactor: Don't define blob at all
* fix: Correct type
* refactor: Port renderer/init to TypeScript
* Update lib/renderer/init.ts
Co-Authored-By: felixrieseberg <felix@felixrieseberg.com>
* refactor: Type this a bit more loosely
* refactor: Type parseOption strictly
* refactor: Port security-warnings to TypeScript
* chore: make aliasify work on .ts files as well
* refactor: Implement feedback <3
* refactor: Correctly call executeJavaScript
* chore: make aliasify work on .ts files as well
* refactor: Port ipc-renderer-internal to TypeScript
* refactor: Correctly import internal ipcRenderer
* refactor: One more rename
* refactor: Fix one more lint issue
* refactor: Correctly reference ipcRendererInternal
* chore: refactor browser IPC into typescript
* chore: refactor app.ts into Typescript
* Refactors app.dock into cpp
* Removes app.launcher which has not existed for 3 years
* Removes 2 deprecated APIs (that have been deprecated for more than one
major)
* Refactors deprecate.ts as well
* refactor: Port window-setup to TS
* refactor: Make the linter happy
* refactor: Sneaky little TS error
* refactor: Correctly import window-setup
* refactor: Implement feedback <3
* refactor: Allow decorators in TS
* refactor: Use named windowSetup in isolatedRenderer
* refactor: Help TS understand
* refactor: Welp, use createEvent again
* refactor: Use the correct target in the decorator
* fix: do not create native api::WebFrame in webFrame
When reloading a page without restarting renderer process (for example
sandbox mode), the blink::WebFrame is not destroyed, but api::WebFrame
is always recreated for the new page context. This leaves a leak of
api::WebFrame.
* fix: remove spell checker when page context is released
* refactor: remove js2asar.py and port logic to JS in more readable / GN-style way
* refactor: further clean up ASAR impl, add new node_action GN template
Unify the behavior between default app and packaged apps:
- create default application menu unless the app has one
- default window-all-closed handling unless the app handles the event
Global requests currently includes DNS over HTTPS requests,
certain cert validation requests (OCSP, AIA, etc) on some platforms
and geolocation requests.
* fix: match Chrome's font fallback behavior
Fixes#15481
* add a cache
* add test
* another test
* fix tests
* arial -> dejavu sans on linux apparently?
* feat: add method to DownloadItem that allows customization of dialog options
* docs: add docs for get/setSaveDialogOptions
* add missing copy constructor for DialogSettings on mac and linux
* fix: don't filter dialog options for mas build, don't return properties
* test: add test for get/setSaveDialogOptions
* fix: remove openDevtools added for debugging
* test: fix failing test because of new event parameter
* docs: use SaveDialogOptions instead of Object
* refactor: remove -new-contents-created event
Chromium expects us to take ownership of WebContents in AddNewContents,
we should not create V8 wrapper in WebContentsCreated, otherwise we
would have WebContents being managed by 2 unique_ptr at the same time.
* refactor: make CreateAndTake take unique_ptr
* remove printing related things from chromium_src
* chore: add printing build flag and patch
* fix: include PrintingService on other platforms too
* fix: printing_handler is only needed on Windows
* fix: format BUILD.gn properly
* fix: rename printing build flag to avoid conflict with chromium
* fix: place previously missed printing calls behind build flag
* fix: accidentally renamed flag in patch file
* fix: don't include all printing strings
* fix: allow ShowItemInFolder and OpenItem to block, fixing a DCHECK crash
* fix: make things compile, some changes got lost while rebasing
* fix: remove rogue line from BUILD.gn
* chore: update patch description
* style: lint fix
* chore: use chromium printing buildflag, move node related stuff out of patch
* revert: remove ScopedAllowBlockingForTesting call
* fix: fix my rebase blooper
* fix: re-add header lost during rebase, update patch
* fix: add <map> include, tweak the patch a bit
* revert: remove rogue diff from patch
* fix: clean up after rebase
* chore: add tts patch and buildflag, makes tts work again
* chore: add tts patch and buildflag, makes tts work again
* fix: make things compile
* build: add relevant tts files for linux
* fix: update patch and patch description, should now compile on mac
* build: move chrome specific sources under chromium_src:chrome target
* build: enable_extensions again
We are depending on them, check `//electron/chromium_src:chrome` target
for more info.
* fix: update tts.patch to receive notifications about browser context destruction
* fix: extend browser process from chrome layer
The global state g_browser_process is shared between //chrome
and //electron.
* spec: add basic speech synthesis test
* spec: skip speech tests on ci
* build: fix compilation on windows
* [ci skip] refactor: create request context from network context
* [ci skip] refactor: subscribe to mojo cookiemanager for cookie changes
* [ci skip] refactor: manage the lifetime of custom URLRequestJobFactory
* refactor: use OOP mojo proxy resolver
* revert: add support for kIgnoreCertificateErrorsSPKIList
* build: provide service manifest overlays for content services
* chore: gn format
* fix: log-net-log switch not working as expected
* spec: verify proxy settings are respected from pac script with session.setProxy
* chore: use chrome constants where possible
* fix: initialize request context for global cert fetcher
* refactor: fix destruction of request context getters
* spec: use custom session for proxy tests
* fix: queue up additional stop callbacks while net log is being stopped
* fix: Add CHECK for cookie manager retrieval
* chore: add helper to retrieve logging state for net log module
* fix: ui::ResourceBundle::GetRawDataResourceForScale => GetRawDataResource
* style: comment unused parameters
* build: move //components/certificate_transparency deps from //brightray
* chore: update gritsettings_resource_ids patch
* chore: update api for chromium 68
* fix: net log instance is now a property of session
* Use weak pointer to avoid race condition
* Use DeleteSoon to delete pointer across threads
* Simplify EventSubscriber
* No need to manually mange V8 convertions
* Fix cpplint warning
We should update cpplint for this, but let's do it in other PR.
* Move UI thread operations to EventSubscriber
* Less and more assertions
Some methods are now private so no more need to assert threads.
* Fix cpplint warnings
* No longer needs the EventEmitted
* EventSubscriber => StreamSubscriber
* Reduce the copies when passing data
* Fix cpplint warnings
* chore: add GN linter
* chore: fix GN lint errors
* try some crazy bash to get a gn exe
* base64 on linux is different
* cloning build_tools doesn't download GN
* download_from_google_storage needs depot_tools in the path
* fixup! chore: add GN linter
* Revert "post all desktop capturer apis to worker threads"
This reverts commit 5a28759fea.
* refactor: desktop capturer module
* Creates the screen and window capturer for the liftime of the app
* Fixes incorrect usage of weak ptr
* build: add //ui/snapshot to chromium_src deps
* fix: handle scenarios when there are no captured sources
* Implementation of getGPUInfo API.
* Clear promise set
* Changes to promise usage
* Minor fixes
* Fix linux build
* Update spec
* Fix lint (linter didn't run on windows locally)
* Test running single test for CI
* Update spec
* Disable nodeIntegration
* Enable contextIsolation
* Re-implement the CSP security check to handle running in
contextIsolation
* Disable bad DCHECKS for the promise helper
* Remove the unused "-d" flag for the electron binary
* Added a way to hide the default help output for electron devs who
don't want to see it every time
* feat: add will-redirect to allow people to prevent 30X redirects
* spec: add tests for the will-redirect event
* refactor: implement will-redirect using NavigationThrottle instead of PostTask
This avoids a potential race condition and immediately cancels the
navigation
* docs: add docs for did-redirect-navigation
* refactor: move AtomNavigationThrottle out of net folder
* refactor: update header guard for atom_navigation_throttle.h
* refactor: fix chromium style errors in the GN build
* refactor: update throttle impl to NOTREACHED and std::make_unqique