* 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
* fix: Invalidate weak ptrs before window Javascript object is destroyed
* chore: add regression test for #14513
This test is similar to the original gist at https://gist.github.com/bpasero/a02a645e11f4946dcca1331d0299149d -- the key is to open multiple windows and add an `app.on('browser-window-focus') listener that accesses window.id.
* fix: last commit didn't test the right thing.
The test needs to run in the main process to reproduce the
conditions reported in #14513
* fix: Notify focus change right away, not on next tick
* fix: emit the JS blur/focus events on next tick to avoid race condition
* address feedback from review
* fix: bind deferred Emit() calls to a WeakPtr
This is so that the deferred Emit() calls will be canceled
if the TopLevelWindow is destroyed.
* chore: remove wip/test code cruft
* fix: make linter happy
* Enable disabled tests
* refactor: cleaner impl of EmitEventSoon()
* Revert "Merge branch 'fix-win-focus' of github.com:electron/electron into fix-win-focus"
This reverts commit 90576806eb271d059f0a215c67e9b4b04f7396a4, reversing
changes made to 9c13e47779a3af78fe0970c1f3d6cd040a5354e6.
* Restore 704722c1, which was removed in error.
We apologise again for the fault in the subtitles. Those responsible for sacking the people who have just been sacked have been sacked.
* First commit
* Add Mac support (1st attempt)
* Add Mac support (2nd attempt)
* Simplify tests
* Restore window state !
* Looking at other tests, seems minimize, maximize, fullscreen are skipped when in CI
* Fix Mac tests
* Restore tests in CI
* Fix typo
* widget getRestoredBounds not working on Mac !!
* widget getRestoredBounds not working on Mac !!
* Add IsNormal function
* Add IsNormal
* IsNormal => isNormal
* Deactivate fullscreen on Mac. Do not receive leave-fullscreen event
* Set default original_frame_
* Set default original_frame_
* Fix Mac
This binds Widget::SetShape, an API that already exists in Chromium (for
Windows and Linux). It's a more reliable method of having some parts of
your window be "click-through" than the current `setIgnoreMouseEvents`
API, which messes around with the `WS_EX_LAYERED` window style on
Windows, causing strange bugs and incompatibility with hardware
acceleration.
Fixes#12701 and supersedes #13131.
Ideally we would have added `setTitleBarStyle()`, but that is a
significantly more involved change. For example, consider the case where
we switch from `hidden` to `normal`. We would not only have to show the
traffic light buttons, we would also have to switch the window from a
frameless to a framed window and deal with various other window state.
Lets instead implement a simple solution for #12701.
- manually close an existing windows before creating a new one.
We have to do it because the `afterEach` hook doesn't get called
if a test fails.
- add some async/await goodies
* Don't use JSON to send the result of `ipcRenderer.sendSync`.
- Change the return type of AtomViewHostMsg_Message_Sync from `base::string16`
to `base::ListValue`
- Adjust lib/browser/api/web-contents.js and /lib/renderer/api/ipc-renderer.js
to wrap/unwrap return values to/from array, instead of
serializing/deserializing JSON.
This change can greatly improve `ipcRenderer.sendSync` calls where the return
value contains Buffer instances, because those are converted to Array before
being serialized to JSON(which has no efficient way of representing byte
arrays).
A simple benchmark where remote.require('fs') was used to read a 16mb file got
at least 5x faster, not to mention it used a lot less memory. This difference
tends increases with larger buffers.
* Don't base64 encode Buffers
* Don't allocate V8ValueConverter on the heap
* Replace hidden global.sandbox with NodeBindings::IsInitialized()
* Refactoring: check NodeBindings::IsInitialized() in V8ValueConverter
* Refactor problematic test to make it more reliable
* Add tests for NaN and Infinity
* Use Chai for webview tests
* Slightly rewrite one of the <webview> tests
"dom-ready event" > "throws a custom error..."
* Use Chai for BrowserWindow tests
* Rewrite BrowserWindow.addDevToolsExtension tests
* Add features.isOffscreenRenderingEnabled()
* Use .isOffscreenRenderingEnabled() to determine if OSR is available
* Add a helper closeTheWindow() function
* Skip OSR tests if they are disabled
* Fix transparent window capture. Transparency is preserved and not converted to black pixels anymore
* Add test to make sure aplha channel exists in captured image
* Persist defaults to webPreferences object to JS land can read the inferred values instead of just user defined values
* Test inherited default propogation
* Refactor to remove coupling from fetching values and defaults
* Test description type
* Fix up tests