electron/lib/browser
Samuel Attard 49aba471dc
feat: add support for associating a Menu with a WebFrameMain (#45138)
* feat: add support for associating a Menu with a WebFrameMain

This allows certain OS level features to activate such as Writing Tools, Autofill.. and Services.

There appears to be a bug in macOS where the responder chain isn't traversed if the menu is not popped up using an event, as such we spoof a fake mouse event at the write coordinates in the right window and use that to open the menu.

* build: fix build on non-mac

* build: oops missed a header

* fix: safely handle optional T* by checking nullptr too

* build: fix gn check and build errors

* docs: suggested changes

* feat: default `frame` to `window.webContents.mainFrame` when possible

* fix: avoid deref nullptr view

* Revert "feat: default `frame` to `window.webContents.mainFrame` when possible"

This reverts commit 2e888368199317d67f6ad931a7e9eff0295c4b1b.

* fix: lint

* Remove redundant scoped objects

This code, including the comments, matches almost exactly the behavior of this argument to the function.

* Add ScopedPumpMessagesInPrivateModes patch

* More null pointer safety

---------

Co-authored-by: clavin <clavin@electronjs.org>
2025-03-28 11:50:07 -07:00
..
api feat: add support for associating a Menu with a WebFrameMain (#45138) 2025-03-28 11:50:07 -07:00
.eslintrc.json chore: add missing .eslintrc.json files to limit imports properly (#35719) 2022-09-20 13:25:33 -05:00
default-menu.ts build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
devtools.ts feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
guest-view-manager.ts refactor: dispatch IPC messages from Session (#45452) 2025-02-17 16:36:28 -05:00
guest-window-manager.ts build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
init.ts feat: ServiceWorkerMain (#45232) 2025-01-24 08:33:44 -05:00
ipc-dispatch.ts refactor: dispatch IPC messages from Session (#45452) 2025-02-17 16:36:28 -05:00
ipc-main-impl.ts build: add import/order eslint rule (#44085) 2024-10-02 19:10:44 -07:00
ipc-main-internal-utils.ts feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
ipc-main-internal.ts feat: add WebContents.ipc (#34959) 2022-08-03 16:55:12 -07:00
message-port-main.ts fix: make sure classes in lib correctly implement Electron interfaces (#40291) 2023-10-25 14:02:15 -04:00
parse-features-string.ts refactor: replace .forEach() with for-of (#39691) 2023-08-31 23:36:43 +09:00
rpc-server.ts feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
web-view-events.ts chore: remove deprecated crashed and renderer-process-crashed events (#40115) 2023-10-18 12:05:41 +02:00