* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* docs: security.md mark 'Enable process sandboxing' as active by default since electron 20
* Adjusted according to feedback
* Updated according to feedback - adjusted sandbox.md
* formatting
* Fixed broken markup
* Implemented docs linting suggestions
* docs: docs/tutorial/sandbox.md - fixed typo
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* docs: web-preferences.md - sandbox: mention default value and relation to nodeIntegration
---------
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* feat: save window state (#47425)
* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* feat: restore window state
* feat: flush display modes on show
* refactor: move utility functions to common area
* feat: clear window state
* fix: wait for the prefs to update
* test: clearWindowState extra test
* test: refine clear window state tests
* test: single monitor restore window tests
chore: rebase on gsoc-2025
* refactor: refine clearWindowState test
* fix: revert default_app back to original
* docs: add comment linking AdjustBoundsToBeVisibleOnDisplay to Chromium code
* fix: add correct permalink
* refactor: ci friendly
* fix: disable windowStatePersistence when no display
* refactor: use reference instead pointer
* fix: skip window state persistence for invalid/fake displays
* refactor: better flag placement
* test: add test to verify window state is not saved when no display
* fix: restore display mode inside show()
* feat: save window state (#47425)
* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* test: clear sharedUserPath before and test
* refactor: hasInvalidDisplay function
* debug: add display info logging for CI
* fix: do not save/restore when window is 0x0
* test: support for multimonitor tests (#47911)
* test: support for multimonitor tests
* fix: update yarn.lock file
* test: support any resolution for new displays
* test: support display positioning
* docs: multi-monitor tests
* test: remove dummy test
* feat: enforce unique window names across BaseWindow and BrowserWindow (#47764)
* feat: save window state (#47425)
* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* feat: enforce unique window names across BaseWindow and BrowserWindow
* docs: update docs for name property
* fix: linter issue with symbol
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* test: remove invalid display test
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
* feat: save window state (#47425)
* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* feat: enforce unique window names across BaseWindow and BrowserWindow
* docs: update docs for name property
* fix: linter issue with symbol
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* feat: save/restore window state
* cleanup
* remove constructor option
* refactor: apply suggestions from code review
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* refactor: forward declare prefservice
* refactor: remove constructor option
* refactor: save window state on move/resize instead of moved/resized
* feat: resave window state after construction
* test: add basic window save tests
* test: add work area tests
* test: asynchronous batching behavior
* docs: add windowStateRestoreOptions to BaseWindowConstructorOptions
* chore: move includes to main block
* Update spec/api-browser-window-spec.ts
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* docs: update docs/api/structures/base-window-options.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* fix: preserve original bounds during window state save in special modes
* feat: save kiosk state in window preferences
* chore: remove ts-expect-error
* test: check hasCapturableScreen before running tests
* test: remove multimonitor tests
* test: add missing hasCapturableScreen checks before tests
* docs: add blurb on saving mechanism
* feat: add debounce window of 200ms to saveWindowState
* docs: remove blurb until finalized
* style: convert constants from snake_case to camelCase
* refactor: initialize prefs_ only if window state is configured to be saved/restored
* refactor: rename window states key
* refactor: store in application-level Local State instead of browser context
* refactor: switch to more accurate function names
* fix: add dcheck for browser_process
* fix: flush window state to avoid race condition
* refactor: change stateId to name
* refactor: change windowStateRestoreOptions to windowStatePersistence
* Update docs/api/structures/base-window-options.md
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
* fix: add warning when window state persistence enabled without window name
* docs: lowercase capital B for consistency
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
* test: add platform test on visibleOnAllWorkspaces tests
visibleOnAllWorkspaces is not supported on Windows
* test: do not skip visibleOnAllWorkspaces tests on Windows
That feature is supported on Linux, so move the test from the
"window states (excluding Linux)" section into the
"window states" section.
* fix: nested it() calls in visibleOnAllWorkspaces specs
* chore: make the process.platform test simpler
* fix: tests that were not run in api-app-spec due to nested it()
* fix: tests that were not run in api-browser-window-spec due to nested it()
* chore: annotate disabled test
* fix: enable `autoHideMenuBar` tests on Linux and Windows (#46818)
* fix: enable autoHideMenuBar tests
* docs: mark autoHideMenuBar as supported on Linux, Windows
* feat: Corner Smoothing CSS rule (Reland)
Reland of #45185
* Fix patch conflicts
* fixup! Fix patch conflicts
* Update expected image
The dashed border is subtly different. The new version is correct and the old one was incorrect.
* feat: allow setting roundedCorners on Windows
* Update docs/api/structures/base-window-options.md
Co-authored-by: Will Anderson <will@itsananderson.com>
---------
Co-authored-by: Will Anderson <will@itsananderson.com>
* feat: Working navigationHistory.restore with just title/url
* feat: Restore page state, too
* chore: Docs, lint, tests
* Implement feedback
* More magic
* Make _awaitNextLoad truly private
* Implement API group feedback
* One more round of feedback
* feat: ServiceWorkerMain
* refactor: disconnect remote
* handle version_info_ nullptr case
* initiate finish request when possible and enumerate errors
* explicit name for test method
* oops
* fix: wait for redundant version to stop before destroying
* docs: clarify when undefined is returned
* chore: remove extra semicolons
* feat: add query-session-end event for Windows
* fix: remove debug line
* feat: notify with reason on session-end
* docs: add comments and return params
* docs: add same docs to the BrowserWindow
* fix: add shutdown reason if lParam == 0
* docs: remove 'force' word
* docs: revert multithreading.md change
* docs: add reasons documentation, reason variable renamed to reasons
* docs: improve 'shutdown' reason wording
* docs: reword with 'can be'
* fix: pass reasons by reference
* fix: use newer approach which expose reasons value directly on Event object
* docs: add escaping
* style: linter fixes
* fix: project now should compile
* fix: EmitWithoutEvent method added, EmitWithEvent moved to private again
* docs: typo fix
Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
* docs: dedicated WindowSessionEndEvent type created
* docs: better wording for session-end event description
Co-authored-by: Will Anderson <will@itsananderson.com>
---------
Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
Co-authored-by: Will Anderson <will@itsananderson.com>