Commit graph

3266 commits

Author SHA1 Message Date
Calvin
abaef13c0b
fix: Revert "feat: Corner Smoothing CSS rule" (#46231)
Revert "feat: Corner Smoothing CSS rule (#45185)"

This reverts commit b75e802280.
2025-03-24 20:36:49 +01:00
John Beutner
cfd64b5f89
fix: handle OnDelegatedSourceListDismissed asynchronously (#46112)
This fixes a crash with the PipeWire capturer caused by a Chromium
change introduced in
5783826.

DesktopMediaListBase now calls Refresh(true) after dispatching
DesktopMediaListObserver::OnDelegatedSourceListDismissed, so it's
important not to call DesktopCapturer::HandleFailure (which deallocates
the DesktopMediaList) synchronously from OnDelegatedSourceListDismissed.
2025-03-24 20:09:11 +01:00
Calvin
b75e802280
feat: Corner Smoothing CSS rule (#45185)
* feat: Corner Smoothing

* Patch Blink to add CSS rule and Painting

* Add `system-ui` keyword

* Add `cornerSmoothingCSS` web preference

* Add tests

* Documentation

* fixup! Documentation

* fix: initialize smoothness value

* Use a 1.0 scale factor in tests

* Fix tests for CI

* Fix tests

* fixup! Merge branch 'main' into clavin/corner-smoothing

* Add code docs

* Document `system-ui` keyword values

* Address review comments

* fixup! Address review comments

* Address review comments

* Update patch to address upstream changes

The patch went from 694 lines to 505 lines, which is a 27.2% smaller!

* fixup! Update patch to address upstream changes
2025-03-24 11:46:12 -04:00
Shelley Vohr
9ec14b91e7
feat: add BrowserWindow.isSnapped() (#46079)
* feat: add BrowserWindow.isSnapped() on Windows

* docs: mark _Readonly_
2025-03-24 12:09:14 +01:00
Shelley Vohr
47cf4e7bfd
fix: Wayland resizing border (#46155)
* fix: Wayland resizing border

Closes https://github.com/electron/electron/issues/44543
Refs CL:5180720

Fixes an issue where the resizing border didn't work as expected on Wayland windows.

* fix: border insets when fullscreen
2025-03-24 12:08:24 +01:00
Charles Kerr
b8150f33db
refactor: remove unused weak_factory_ in electron_management_api_delegate.cc (#46200)
refactor: remove unused weak_factory_

Appears to have been added in 3745b76da but never used
2025-03-24 12:07:49 +01:00
Charles Kerr
02a4bd5942
refactor: remove unused method ProxyingWebSocket::web_request_api() (#46201)
Appears to have been added in c608d6d7 but never used
2025-03-24 10:09:24 +01:00
Charles Kerr
7ed4f0ca27
perf: use absl::flat_hash_map instead of std::unordered_map (#46202)
* perf: make ElectronUsbDelegate::controller_map_ an absl::flat_hash_map

* perf: make ElectronSerialDelegate::controller_map_ an absl::flat_hash_map

* perf: make ElectronHidDelegate::controller_map_ an absl::flat_hash_map

* perf: make FrameTreeNodeIdMap an absl::flat_hash_map

* perf: make AutofillDriverFactory::driver_map_ an absl::flat_hash_map

* perf: make asar::Archive::external_files_ an absl::flat_hash_map

* perf: make VersionIdMap an absl::flat_hash_map

* perf: make ObjectCache::proxy_map_ an absl::flat_hash_map

* docs: add TODO to investigate absl map in KeyWeakMap
2025-03-24 10:09:14 +01:00
Charles Kerr
5623c96dd7
refactor: remove unused field ServiceWorkerMain::weak_factory_ (#46171)
refactor: remove unused field ServiceWorkerMain::weak_factory_

Added in a467d06, appears to have never been used
2025-03-23 10:14:45 +01:00
Charles Kerr
3fd35abe98
refactor: remove unused method ElectronBrowserContext::GetWeakPtr() (#46170)
* refactor: use forward declaration of MediaDeviceIDSalt in electron_browser_context.h

* refactor: remove unused #include from browser_context.h

* refactor: remove unused ElectronBrowserContext::GetWeakPtr()

last use removed in Aug 2020 by bac2f46
2025-03-22 10:15:15 -05:00
Charles Kerr
a81e11d9de
refactor: use = default to define trivial destructors (#46165)
refactor: use '= default' to define trivial destructors
2025-03-21 16:15:34 -05:00
Charles Kerr
6723bfbe32
refactor: reduce coupling in electron::api::Protocol (#46122)
* refactor: decouple api::Protocol from ElectronBrowserContext

now they do not know about each other

* refactor: make electron::api::ProtocolError private

* refactor: remove unused isolate arg in Protocol constructor

* refactor: use =default for trivial destructor
2025-03-21 07:33:25 -05:00
Shelley Vohr
32141eacfb
refactor: use upstream Widget::IsVisibleOnAllWorkspaces() (#45887)
* refactor: use upstream Widget::IsVisibleOnAllWorkspaces()

* chore: add to breaking changes
2025-03-20 23:43:47 -05:00
Charles Kerr
1b5db9989e
refactor: make URLPipeLoader private (#46113)
Move the URLPipeLoader class into an anonymous namespace in
electron_url_loader_factory.cc.
2025-03-20 15:47:47 -05:00
Charles Kerr
46967ca9c9
refactor: Add ElectronBrowserContext::BrowserContexts() (#46089)
* refactor: add ElectronBrowserContext::BrowserContexts()

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronBrowserMainParts::PostMainMessageLoopRun()

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::IsValidContext()

* refactor: use ElectronBrowserContext::BrowserContexts() in ElectronExtensionsBrowserClient::BroadcastEventToRenderers()

* refactor: move PartitionKey, BrowserContextMap private

* refactor: add ElectronBrowserContext::IsValidContext()

decouple ElectronExtensionsBrowserClient from the internals of ElectronBrowserContext
2025-03-20 11:17:26 -05:00
Charles Kerr
273baf4ec2
refactor: use base::NumberToString() (#46141)
base::NumberToString() is slightly more efficient than
absl::StrFormat("%u").
2025-03-20 10:13:28 +01:00
Charles Kerr
c4800d9934
refactor: remove ToV8(isolate, const char*) (#46108) 2025-03-20 10:04:50 +01:00
Shelley Vohr
86cc9f626f
fix: APNS token ids are lowercase ASCII (#46101) 2025-03-20 07:57:50 +01:00
Shelley Vohr
09a3bcf0f0
fix: webContents.print() crash on Linux (#46087) 2025-03-20 06:41:00 +01:00
electron-roller[bot]
b13f05e2dc
chore: bump chromium to 136.0.7067.0 (main) (#46018)
* chore: bump chromium in DEPS to 136.0.7066.0

* chore: bump chromium in DEPS to 136.0.7067.0

* 6325710: [LNA] Add Local Network Access permission type

Refs 6325710

* 6342514: Create frame mojo endpoints in renderer during window.open()

Refs 6342514

* 6344040: Create widget mojo endpoints in renderer process for window.open()

Refs 6344040

* chore: update patches

* 6349218: Move ExtensionService::install_directory() to ExtensionRegistrar

Refs 6349218

* 6349395: Move ExtensionService::extensions_enabled() to ExtensionRegistrar

Refs 6349395

* 6331510: Migrate views::Background class to ui::ColorVariant | 6331510

* build: reorder set-cookie step https://github.com/electron/electron/pull/46091

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: alice <alice@makenotion.com>
2025-03-18 19:20:54 -04:00
Charles Kerr
4bf99c9bea
refactor: add ElectronBrowserContext::GetDefaultBrowserContext() (#46065)
* refactor: add ElectronBrowserContext::DestroyAllContexts()

Simpler semantics than previous implementation; also hides the
"default context must be destroyed last" implementation detail.

* refactor: add ElectronBrowserContext::GetDefaultBrowserContext()

clearer semantics than everyone calling From("", false)
2025-03-17 08:43:23 -05:00
Charles Kerr
9513486bf3
refactor: use GetDefaultStoragePartition() instead of GetStoragePartition(nullptr) (#46064)
refactor: use GetDefaultStoragePartition()

Use GetDefaultStorageParition() instead of GetStoragePartition(nullptr)

- It improves code uniformity, since we use get-default everywhere else
- It's more readable
- It's marginally faster, since GetStoragePartition() has more steps

Added in 49b0a1bf4a
2025-03-17 08:39:55 -05:00
Charles Kerr
bea7d618f1
fix: warning in file picker UI (#46067) 2025-03-16 20:49:15 -05:00
Charles Kerr
73a017577e
perf: avoid redundant map lookup in ElectronBrowserContext::From() (#46044)
perf: avoid redundant map lookup in ElectronBrowserContext::FromPath()
2025-03-15 09:51:20 -05:00
Charles Kerr
5f0603ed28
fix: ElectronBrowserContext raw_ptr bug + remove dead code (#46030)
refactor: remove unused ElectronBrowserContext::extension_system()

Last use removed on Jul 21, 2020 by 2fb14f5 in PR #24575

This fixes a raw_ptr warning by letting us remove the raw_ptr field
`ElectronBrowserContext::extension_system_`.
2025-03-14 23:35:10 -05:00
Sam Maddock
afca4e271e
feat: ServiceWorkerMain.scriptURL (#45863)
feat: serviceWorker.scriptURL
2025-03-14 21:00:13 -04:00
Charles Kerr
30d2fadb28
refactor: replace base::StringPrintf() calls with absl::StrFormat() (#46024)
The former is now a pass-through for the latter and is slated for removal

Xref: https://issues.chromium.org/issues/40241565

4907781
2025-03-14 17:14:32 -05:00
Charles Kerr
3271b82094
refactor: remove unused system header includes (#46015)
* chore: remove unused #include <string>

* chore: remove unused #include <optional>

* chore: remove unused #include <vector>

* chore: remove unused #include <string_view>

* chore: remove unused #include <memory>

* chore: remove unused #include <utility>

* chore: remove unused #include <tuple>

* chore: remove unused #include <unordered_set>

* chore: remove unused #include <functional>

* chore: iwyu <set>

* chore: iwyu <map>
2025-03-14 10:59:15 -05:00
Michaela Laurencin
4812b4e6c2
fix: prevent title change for within page navigation (#45981)
* fix: prevent title change for on page navigation

* add back and forward testing

* update Chromium comment

* remove errant script tag
2025-03-14 12:10:23 +01:00
Shelley Vohr
7c0b7b417b
fix: emit context-menu event in Windows draggable regions (#45851)
fix: emit context-menu event in Windows draggable regions
2025-03-14 10:29:29 +01:00
Charles Kerr
c813bc2a92
refactor: use private inheritance from mojo::MessageReceiver (#45973)
* refactor: make UtilityProcessWrapper inherit privately from mojo::MessageReceiver

* refactor: make ParentPort inherit privately from mojo::MessageReceiver

* refactor: make MessagePort inherit privately from mojo::MessageReceiver
2025-03-12 19:06:41 +01:00
Shelley Vohr
5ce41bac8d
fix: system-context-menu should only fire in draggable regions (#45893)
fix: system-context-menu should only fire in draggable regions
2025-03-12 13:47:58 +01:00
Charles Kerr
f2b09ff0bd
fix: remove redundant MediaCaptureDevicesDispatcher::GetInstance() call (#45929)
fix: remove redundant MediaCaptureDevicesDispatcher::GetInstance() call

This appears to be a copy-paste error introduced in 465dee2c
2025-03-10 09:44:24 -05:00
electron-roller[bot]
b0c11371e0
chore: bump chromium to 136.0.7058.1 (main) (#45928)
* chore: bump chromium in DEPS to 136.0.7056.0

* chore: update mas_avoid_private_macos_api_usage.patch.patch

no manual changes; patch applied with fuzz

* chore: update fix_adapt_exclusive_access_for_electron_needs.patch

patch applied manually due to context shear

6319958: [FS] Replace GURL with url::Origin for Excluisve Access Bubble | 6319958

* chore: update feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch

no manual changes; patch applied with fuzz

6311876: Expose captured surface resolution for MacOS | 6311876

* chore: e patches all

* 6319958: [FS] Replace GURL with url::Origin for Excluisve Access Bubble | 6319958

* 6326673: views: Delete the single-parameter Widget::InitParams constructor. | 6326673

* 6331102

* 6331102: [A11yPerformance] Rename AXMode::kScreenReader to kExtendedProperties | 6331102

Sync with shell/browser/ui/webui/accessibility_ui.cc to
upstream chrome/browser/accessibility/accessibility_ui.cc
changes in 4af8657

* chore: bump Chromium 136.0.7058.1 (#45933)

chore: bump chromium in DEPS to 136.0.7058.1

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 00:30:34 -05:00
Charles Kerr
288ef37b1d
perf: prefer base::SplitStringPiece() over base::SplitString() (#45924)
* perf: use base::SplitStringPiece() in SetNodeOptions()

* perf: use base::SplitStringPiece() in StringToAccelerator()

* refactor: StringToAccelerator() now takes a std::string_view
2025-03-09 17:36:13 -05:00
electron-roller[bot]
20414f66ca
chore!: bump chromium to 136.0.7054.0 (main) (#45923)
* chore: bump chromium in DEPS to 136.0.7054.0

* chore: update allow_in-process_windows_to_have_different_web_prefs.patch

Xref: 5906158

patch applied manually due to context shear

* chore: e patches all

* refactor!: Session.clearStorageData(syncable)

Xref: 6309405

Remove syncable type from opts.quota in Session.clearStorageData(opts)
because it that category has been removed upstream.

BREAKING CHANGE: Removed ses.clearDataStorage({ quota: 'syncable' })

* docs: deprecate Session.clearDataStorage({ quota })

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-07 17:49:21 -06:00
electron-roller[bot]
458b14b8ed
chore: bump chromium to 136.0.7053.1 (main) (#45906)
* chore: bump chromium in DEPS to 136.0.7052.0

* chore: update mas_avoid_private_macos_api_usage.patch.patch

6318359

patch applied manually due to context shear

* chore: update preconnect_manager.patch

Xref: 6318420

patch applied manually due to context shear

* chore: e patches all

* chore: bump chromium to 136.0.7053.1

* chore: update fix_remove_profiles_from_spellcheck_service.patch

Xref: 6326575

patch applied manually due to context shear

* chore: e patches all

* chore: revert removal of v8 API used by Node.js

* devtools: Remove DevToolsUIBindings::SendJsonRequest() | 6326236

* 6244461: Merge //content/common/user_agent.cc into //components/embedder_support:user_agent | 6244461

* 6313744: Migrate views::Background factory methods to ColorVariant | 6313744

* 6314545: Remove multiple argument support from base::ToString() | 6314545

* 6317362: [Extensions] Inline MessagingDelegate::CreateReceiverForTab() | 6317362

* 6308998: Add SettingAccess structured metrics event for DevTools | 6308998

* 6295214: Remove redundant state field in per-extension preferences | 6295214

NB: this change is copied from the upstream change to extensions/shell/browser/shell_extension_loader.cc

* fix: ui/ linter error

This is showing up in an eslint build step in Electron:

> /__w/electron/electron/src/out/Default/gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts
>   77:23  error  This assertion is unnecessary since the receiver accepts the original type of the expression  @typescript-eslint/no-unnecessary-type-assertion
>
> ✖ 1 problem (1 error, 0 warnings)
>   1 error and 0 warnings potentially fixable with the `--fix` option.

However, removing the assertion causes a typescript build failure:

> gen/ui/webui/resources/cr_elements/preprocessed/cr_menu_selector/cr_menu_selector.ts:77:23 - error TS2345: Argument of type 'HTMLElement | null' is not assignable to parameter of type 'HTMLElement'.
>   Type 'null' is not assignable to type 'HTMLElement'.
>
> 77         items.indexOf(this.querySelector<HTMLElement>(':focus'));
>                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So I think the two different steps may be picking up typescript definitions.

This patch should be removed after the issue is tracked down
and fixed in a followup task.

* fix: -Wnonnull warning

Fixes this warning:

> 2025-03-07T01:05:01.8637705Z ../../third_party/electron_node/src/debug_utils.cc(257,12): error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
> 2025-03-07T01:05:01.8638267Z   257 |     return nullptr;
> 2025-03-07T01:05:01.8638481Z       |            ^~~~~~~
> 2025-03-07T01:05:01.8638700Z 1 error generated.

Not sure why this warning was never triggered before; `git blame`
indicates this code hasn't changed in ages:

> c40a8273ef2 (Michaël Zasso    2024-05-10 09:50:20 +0200 255) #endif  // DEBUG
> 8e2d33f1562 (Anna Henningsen  2018-06-07 16:54:29 +0200 256)     }
> 247b5130595 (Refael Ackermann 2018-10-22 15:07:00 -0400 257)     return nullptr;
> 247b5130595 (Refael Ackermann 2018-10-22 15:07:00 -0400 258)   }

Presumably this is failing in this Chromium roll due to a
clang version bump.

We should remove this patch after upstreaming it.

* docs: add upstream pr link for Node patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-07 11:35:59 -06:00
Robo
530ccfe350
fix: resolve font list in default prefernce values (#45905)
* fix: resolve font list in default prefernce values

* chore: fix unsafe buffer usage

* docs: add code comment
2025-03-07 18:22:03 +09:00
Robo
041ada1586
build: match upstream with unsafe buffer paths (#45853)
* build: match upstream with unsafe buffer paths

* Don't assume STL iterators are pointers

Refs https://issues.chromium.org/issues/328308661

* chore: spanify process_singleton_win.cc
2025-03-06 16:04:18 -05:00
Shelley Vohr
99c943df23
fix: setContentProtection(true) after hide on Windows (#45868)
fix: content protection after hide on Windows

5789117
2025-03-04 16:39:59 -05:00
Sam Maddock
8c11764800
feat: WebContents.focusedFrame (#45667)
feat: webContents.focusedFrame
2025-03-04 11:38:58 -05:00
electron-roller[bot]
e8631b2f3a
chore: bump chromium to 135.0.7047.0 (main) (#45859)
* chore: bump chromium in DEPS to 135.0.7043.0

* chore: bump chromium in DEPS to 135.0.7045.0

* 6305947: Preconnect to the Glic FRE when the button is hovered.

6305947

* 6207093: Remove line_bounds from ImeCompositionRangeChanged

6207093

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-03-03 14:26:52 +01:00
electron-roller[bot]
add374ef6a
chore: bump chromium to 135.0.7041.2 (main) (#45850)
* chore: bump chromium in DEPS to 135.0.7041.2

* [Extensions] Remove ExtensionsBrowserClient::GetUserAgent()

6306854

* chore: update patches

* [api] Remove deprecated FunctionCallbackInfo::Holder()

6309166

* [test] Add createExternalizableTwoByteString to extension

6304942

* fixup [test] Add createExternalizableTwoByteString to extension

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-02-28 17:29:23 -05:00
co63oc
36ec9d7236
docs: fix spelling errors in code comments (#45842)
chore: Fix typos
2025-02-28 12:24:00 +01:00
Shelley Vohr
eac1a7ff68
fix: context-menu event emitted in draggable regions (#45813)
* fix: context-menu event emitted in draggable regions

* fix: only trigger on mouse release
2025-02-27 14:44:46 -05:00
electron-roller[bot]
00089a951b
chore: bump chromium to 135.0.7039.0 (main) (#45836)
* chore: bump chromium in DEPS to 135.0.7039.0

* chore: update patches

* extensions: Refactor ExtensionService GrantPermissionsAndEnableExtension

6302374

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-02-27 13:20:42 -05:00
reito
b8d0f18ff8
docs: add docs about shared texture mode osr (#45670)
* docs: add docs about shared texture mode osr

* docs: add docs about shared texture mode osr

* docs: fix dot

* 更新 web-contents.md

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>

---------

Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
2025-02-27 11:10:58 -05:00
Keeley Hammond
9b6ba1ced1
fix: re-enable MacWebContentsOcclusion feature flag (#45775) 2025-02-25 09:28:09 -08:00
Charles Kerr
0de1e8e610
refactor: remove unused v8::Isolate* arg from GlobalShortcut constructor (#45773)
refactor: remove unused isolate arg from GlobalShortcut constructor

has not been used since f1a0d5e811 (#22755)
2025-02-24 19:38:20 -06:00
reito
f3259be73c
feat: remove osr framerate limit when use shared texture (#45669)
feat: remove framerate limit, if use shared texture osr.
2025-02-24 10:21:46 -05:00