* feat: emit resize edge with will-resize event
fix: wparam type
fix: private member usage on mac
docs: will-resize event edge option
refactor: 'info' -> 'details' for better type gen
* Update docs/api/browser-window.md
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
* Update docs/api/browser-window.md
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
* Added loadFile instead of loadURL in the example
For loading a local file the loadFile API is a better way to load any html file in the Renderer process.
Have changed it in the example.
* Changed backticks to single quote to correct for linting error
In order to correct the linting error reported by the bot, I have changed backticks to single quote in the example.
* feat: enable nativeWindowOpen by default
* set nativeWindowOpen: false on spec/ main window
* update snapshots
* fix tests
* fix test
* fix webview test missing allowpopups
* fix other test
* update default
* fix: invoke the window open handler for _blank links
* feat: add disposition to setWindowOpenHandler details
* fix: pass postData to new-window event
* postData can be heterogeneous
* fix type of postBody
* fix type of UploadFile and UploadRawData to be discriminated unions
* exclude the empty string from additionalFeatures
* add a test
* add postBody and referrer to setWindowOpenHandler args
* appease typescript
* Update api-browser-window-spec.ts
* update snapshots
* docs: update Node global symbols example to use contextBridge
* Trigger Build
* docs: change Node API example to show how to expose a crypto API
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* docs: Fix lint warning for crypto code sample
* docs: update node API example description to emphasize APIs instead of symbols
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
* feat: Raise a browser view via `BrowserWindow.setTopBrowserView()`.
This is similar to removing and re-adding a browser view, but avoids a visible flicker as the browser view is not removed from the window when using `setTopBrowserView`. Note: if the given browser view is not attached to the window, it will be added.
This commit contains the macOS implementation.
* feat: setTopBrowserView support for Windows and Linux
* docs: add info about setTopBrowserView
* docs: Clarify behavior when browserView is not yet attached.
* fix: throw en error when browserView is not attached to the window
* fix: build error
* fix: test
* fix: add test case
* fix: tests
* fix: reparenting
* fix: close second window in tests
Co-authored-by: sentialx <sentialx@gmail.com>
* fix: optionally transform processes on win.SetVisibleOnAllWorkspaces on macOS, making it backwards-compatible with v9.2.1 (#27101)
* fix: optionally transform processes on win.SetVisibleOnAllWorkspaces on macOS, making it backwards-compatible with v9.2.1 (#27101)
Co-authored-by: Cyrus Roshan <cyrusroshan@users.noreply.github.com>
* Rewrite titleBarStyle impls with WindowButtonsView
* Remove fullscreenWindowTitle option
* Make buttons show correctly under RTL
* Fix docs about traffic lights position
* Fix test on fullscreen resizable
* Fix button states with closabe/minimizable/fullscreenable
* Fix typo
* Deprecate the fullscreenWindowTitle option
* feat: support exclude from capture on Windows
Check for WDA_EXCLUDEFROMCAPTURE support, and fallback to WDA_MONITOR. Windows versions that support exclude from capture will exclude the window entirely when `setContentProtection` is enabled similar to how Mac behaves. Fall back to `WDA_MONITOR` for windows verisions that do not support.
This flag is mentioned at the very end of a Microsoft blog post here: https://blogs.windows.com/windowsdeveloper/2019/09/16/new-ways-to-do-screen-capture/
Use WDA_EXCLUDEFROMCAPTURE for content protection on windows
Starting with Windows 10, version 2004 this will exclude a window similar to the expected behavior on mac. It is safe to use WDA_EXCLUDEFROMCAPTURE on older Windows versions, as it will still behave as if WDA_MONITOR is applied.
https://github.com/microsoft/Windows.UI.Composition-Win32-Samples/issues/64#issuecomment-697074762
See the docs here: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowdisplayaffinity
* docs: update setContentProtection docs
Update `setContentProtection` docs with `WDA_EXCLUDEFROMCAPTURE` info. This is to support screen capture fully excluding a particular window instead of showing it as a black screen.
* feat: add worldSafe flag for executeJS results
* chore: do not log warning for webContents.executeJS
* Apply suggestions from code review
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
* chore: apply PR feedback
* chore: split logic a bit
* chore: allow primitives through the world safe checl
* chore: clean up per PR feedback
* chore: flip boolean logic
* chore: update per PR feedback
* chore: fix typo
* chore: fix spec
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Address incorrect typing for isEnabled. The root cause of this was due
to missing backticks which caused the docs parser to think that the
return type of the `isEnabled` function was null, where it was supposed
to be a boolean type.
The side effect of this was that the generated typescript typings were
incorrect for this function.
Fixes#24409
* docs: document what experimental means explicitly
* Apply suggestions from code review
Co-Authored-By: Jeremy Apthorp <jeremya@chromium.org>
* Update experimental.md
Co-authored-by: Jeremy Apthorp <jeremya@chromium.org>
* docs: fix minor grammar error 'punctuations'
* docs: fix minor grammar error pluralizing Chromium
* docs: fix typo 'updateCurrentActiviy'
* docs: use consistent spelling of 'behavior'
* docs: use 'macOS' instead of 'Mac OS' or 'OS X'.
* docs: use 'GTK' instead of 'GTK+'
https://mail.gnome.org/archives/gtk-devel-list/2019-February/msg00000.html
* docs: minor capitalization: use 'TCP' not 'tcp'
* Update docs/development/build-instructions-linux.md
Co-Authored-By: Mark Lee <malept@users.noreply.github.com>
Co-authored-by: Mark Lee <malept@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
* feat: default gtk darkTheme option to nativeTheme.shouldUseDarkColors for better platform support
* chore: update syntax for PR feedback
* refactor: only define SetGTKDarkThemeEnabled when needed
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
* feat: set app.enableRendererProcessReuse to true by default
* chore: add context aware info to breaking changes doc
* spec: fix nodeIntegration in child windows test for rendererprocessreuse
* spec: fix remote listeners in destroyed renderers spec as the error is now async
* Update api-browser-window-spec.ts
* chore: deprecate affinity
* chore: fix docs
* spec: handle tests crashing without an exist code
* spec: update tests for new rendererprocessreuse default
* spec: with renderer process re-use we get to destroy less views
* feat: custom positioning for traffic light buttons
* remove NSLog and unnecessary call-site in IsVisible()
* no longer need to check if entering fullscreen
* change API to take a point object
Co-authored-by: tonyfwoo <55114329+tonyfwoo@users.noreply.github.com>
* chore: add code required to use chromes spellchecker
* chore: fix linting
* chore: manifests needs buildflags now
* chore: add dictionarySuggestions to the context menu event when the spellchecker is active
* chore: enable by default for windows builds
* chore: add patch to remove incognito usage in the spellchecker
* chore: add dependencies on spellcheck common and flags
* chore: conditionally include spell check panel impl
* chore: fix deps for spellcheck feature flags
* chore: add patch for electron resources
* chore: add dependency on //components/language/core/browser
* chore: patches to make hunspell work on windows
* build: collect hunspell dictionaries into a zip file and publish
* chore: clean up patches
* chore: add docs and set spell checker url method
* chore: fix error handling
* chore: fix hash logic
* build: update hunspell filename generator
* fix: default spellchecker list to the current system locale if we can
* docs: document the language getter
* chore: patch IDS_ resources for linux builds
* feat: add spellcheck webpref flag to disable the builtin spellchecker
* chore: fix docs typo
* chore: clean up spellchecker impl as per feedback
* remove unneeded deps
Sometimes it's necessary to convey more information about the window to screen reader users only (simply putting everything to the window title might be unnecessarily noisy).
For example, Chromium uses that technique to tell screen reader users that the window is in incognito mode (the incognito window looks differently and doesn't have «incognito» in the title, but for blind users the screen reader will announce that it's incognito).
* feat: Implement BrowserWindow.moveAbove(mediaSourceId)
BrowserWindow.{focus,blur,moveTop}() are not enough in some
situations. For example when implementing an overlay that
follows another window that can lose focus. In that case
it is useful to move the overlay above the tracked window.
sourceId is a string in the format of DesktopCapturerSource.id,
for example "window:1869:0".
Notes: Added BrowserWindow.moveAbove(mediaSourceId)
https://github.com/electron/electron/issues/18922
* feat: Implement BrowserWindow.getMediaSourceId
Return the Window id in the format of DesktopCapturerSource's id.
For example "window🔢0".
https://github.com/electron/electron/issues/16460
Notes: Added BrowserWindow.getMediaSourceId
* docs: remove implicit 'any' and 'Object' types from the docs
* docs: more docs improvements, remove all remaining empty interfaces
* chore: update tests for better types
* test: move some BrowserWindow specs to the main process
* uncomment cross-site test
* move more tests
* re-enable, refactor and move visibilitychange specs
* move new-window event tests and re-enable them on mac
* move max/minimize event tests
* move modal tests
* move beginFrameSubscription tests
* move savePage test
* move BrowserWindow options argument is optional test
* move restore, unmaximize, fullscreen tests
* move parent window tests
* don't wait for show event on windows (#8664)
* add debugging logs to fullscreen tests
* more debugging on windows
* explicitly destroy browserviews to prevent crash during gc
* only await show on darwin
* more event timing fixes
* disable max/minimize event tests on linux, since they're broken on CI
For now it only adds the ability to place the window below
the task bar while still being always on top.
Previous behaviour was always showing the window above the task
bar when top is true. We keep this default behaviour, i.e. when
the 'level' parameter is omitted.
https://github.com/electron/electron/issues/18933
Notes: Can set a window always on top but behind the taskbar on Windows
It was not implemented on Mac despite being available as a constructor
option. Implementation already exists on Windows. Linux case can be
separately.
https://github.com/electron/electron/issues/19032
Notes: Implemented BrowserWindow.setFocusable on macOS.
* docs: ensure that optionality matches between documented params and signatures
* docs: ensure that all optional declarations are lower case
* chore: fix broken link