This fixes a nasty warning / permission dialog that pops up to end-users
when consuming legacy APIs. Chrome has flipped these flags via field trials
as have other Electron apps. It should just be the default.
This aligns us with Chromiums flags / capabilities in regards to using SCK for
everything. Currently on 14.4 Electron apps will pop warnings for usage of
deprecated APIs. With this change and a few "enable-features" toggles.
`--enable-features="ScreenCaptureKitMac,ScreenCaptureKitStreamPickerSonoma,ThumbnailCapturerMac:capture_mode/sc_screenshot_manager"`
As Chromium enables these by default Electron will inherit those changes, apps wishing to skip ahead can apply these flags early.
* refactor: use base::WriteJson() in ListValueToNSArray()
refactor: use base::WriteJson() in DictionaryValueToNSDictionary()
* refactor: use base::WriteJson() in Debugger::SendCommand()
* refactor: use base::WriteJson() in ScriptingExecuteScriptFunction::Run()
* refactor: use base::WriteJson() in HandleAccessibilityRequestCallback()
`delegated_frame_host_` holds a pointer to `delegated_frame_host_client_`.
Since `delegated_frame_host_client_` was being destroyed first, that
pointer was dangling in the OSRWHV destructor.
Also, make these two unique_ptr fields `const` since they point to the
same objects for the lifespan of the OSRWHV.
* refactor: do not use banned std::to_string() in ServiceWorkerContext::GetAllRunningWorkerInfo()
* refactor: do not use banned std::to_string() in REPORT_AND_RETURN_IF_FAILED()
* refactor: do not use banned std::to_string() in JSChunkedDataPipeGetter::OnWriteChunkComplete()
* refactor: do not use banned std::to_string() in SetCrashKey()
* chore: remove unused #include
* fix: ElectronBrowserContext::PartitionKey comparisons
Use c++20 default comparisons to simplify + fix PartitionKey sorting:
- The equality operator is broken. `PartitionKey{"foo", false}` is both
equal, to and less than, `PartitionKey{"foo", true}`
- For some keys, the same session can be retrieved via both `fromPath()`
and `fromPartition()`. This use case was discussed and removed from
the original PR after code review said "always returning different
sessions feels lower maintenance." The current behavior is a bug that
comes from the comparison operators not checking the keys' types.
Xref: 3f1aea9af9 (r1099745359)
Xref: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#Default-comparisons-allowed
* fixup! fix: ElectronBrowserContext::PartitionKey comparisons
* refactor: do not use deprecated ToInternalValue() in ElectronExtensionLoader::FinishExtensionLoad()
* refactor: do not use deprecated ToInternalValue() in NotificationPresenterWin::SaveIconToFilesystem()
* chore: rename temp variable to now_usec for clarity
* refactor: use NoDestructor for g_io_thread_application_locale
* refactor: use NoDestructor for ExtensionActionAPI::GetFactoryInstance()
* refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider()
* refactor: use NoDestructor for feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
* chore: remove unused #include
* fixup! refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider()
make sure instance is static
* chore: remove unused #include "base/lazy_instance.h"
* chore: bump chromium in DEPS to 122.0.6223.0
* 5129828: Removes special cases for selenium-atoms dependencies.
https://chromium-review.googlesource.com/c/chromium/src/+/5129828
* chore: fixup patch indices
* 5139789: Deduplicate BrowserContext's ResourceContext
https://chromium-review.googlesource.com/c/chromium/src/+/5139789
* 5148579: Simplify SelectFileDialog::Listener
https://chromium-review.googlesource.com/c/chromium/src/+/5148579
* 5134038: Code Health: Use string_view in base::i18n::BreakIterator::SetText
https://chromium-review.googlesource.com/c/chromium/src/+/5134038
* 5137427: Code Health: Use string_view in SpellCheck::SpellCheckWord
https://chromium-review.googlesource.com/c/chromium/src/+/5137427
* [libcxx] adds ranges::fold_left_with_iter and ranges::fold_left
Notable things in this commit:
* refactors `__indirect_binary_left_foldable`, making it slightly
different (but equivalent) to _`indirect-binary-left-foldable`_, which
improves readability (a [patch to the Working Paper][patch] was made)
* omits `__cpo` namespace, since it is not required for implementing
niebloids (a cleanup should happen in 2024)
* puts tests ensuring invocable robustness and dangling correctness
inside the correctness testing to ensure that the algorithms' results
are still correct
[patch]: https://github.com/cplusplus/draft/pull/6734
* chore: bump chromium in DEPS to 122.0.6224.0
* 5154766: [Refresh 2023] [GTK] Fix gap above toolbar with fractional scaling
https://chromium-review.googlesource.com/c/chromium/src/+/5154766
* chore: fixup patch indices
* 5094458: Remove extra CGColorSpace parameters from skia and ui helpers
https://chromium-review.googlesource.com/c/chromium/src/+/5094458
* chore: bump chromium in DEPS to 122.0.6226.0
* chore: update patches
* chore: bump chromium in DEPS to 122.0.6227.0
* chore: update patches
* chore: bump chromium in DEPS to 122.0.6228.0
* chore: update patches
* chore: bump chromium in DEPS to 122.0.6230.0
* chore: bump chromium in DEPS to 122.0.6232.0
* chore: bump chromium in DEPS to 122.0.6234.0
* chore: bump chromium in DEPS to 122.0.6236.2
* chore: update patches
* fix: remove --disable-color-correct-renderering
Per https://electronhq.slack.com/archives/CB6CG54DB/p1698444047862459 it is not used any more and was never documented.
* chore: add WEB_PRINTING to content permission converter
Unused in non-cros so no need to document
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5136178
* chore: Views is now vec<raw_ptr> instead of raw<T*>
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5140028
* spec: add Iterator to global intrinsics
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
* chore: migrate from base::StringPiece to std::string_view in keyboard_util.cc
* chore: migrate from base::StringPiece to std::string_view in error_thrower.cc
* chore: migrate from base::StringPiece to std::string_view in electron_api_web_contents.cc
* chore: migrate from base::StringPiece to std::string_view in gin_helper/dictionary.h
* chore: migrate from base::StringPiece to std::string_view in electron_api_url_loader.cc
* chore: phase out internal use of base:::StringPiece
`base::StringPiece` is being phased out upstream. Its code has been
removed upstream and it's just a typedef for `std::string_view`.
They haven't removed the typedef yet, so this PR tries to get ahead
of future breakage by migrating "internal" use (i.e. leaving alone the
places where the `base::StringPiece` name is coming from an upstream
method that we override).
Xref: https://bugs.chromium.org/p/chromium/issues/detail?id=691162
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4294483
Xref: https://docs.google.com/document/d/1d4RnD1uAE2t4iANR0nXy82ASIPGsPuw2mpO6v6T7JKs
refactor: use fixed-size arrays for the font cache
Since we know at compile time which [family x script] combos we want to
cache, we can hold the cache in fixed std::arrays instead of in nested
std::unordered_maps.
* fix: macOS maximize button shouldn't be disabled just because the window is non-fullscreenable
* add test
* fix test by enabling maximize button if `resizable && (maximizable || fullscreenable)` instead of `(resizable && maximizable) && fullscreenable`
* refactor: use base::flat_map in ElectronMenuModel
* refactor: use base::flat_map in BuildSubmenuFromModel()
* refactor: use base::flat_map in GetDialogsMap()
* refactor: use base::flat_map in DesktopCapturer
* refactor: use base::flat_map, flat_set in ElectronBrowserClient
* refactor: use base::flat_map in ProxyingURLLoaderFactory
* refactor: use base::flat_map in MapToCommonId()
* refactor: use base::flat_map for g_map_id
* refactor: use base::flat_map for ViewsDelegate::AppbarAutohideEdgeMap
* refactor: use base::flat_map for App::app_metrics_
* refactor: use base::flat_map for PowerSaveBlocker::wake_lock_types_
* refactor: use base::flat_map for NativeImage::hicons_
* refactor: use base::flat_map for MenuViews::menu_runners_
* refactor: use base::flat_map for WebViewManager::web_contents_embedder_map_
* refactor: use base::flat_map for InspectableWebContents::extensions_api_
* refactor: use base::flat_set for libnotify GetServerCapabilities()
* refactor: use base::flat_set for InspectableWebContents::loaders_
* refactor: use base::flat_set for ElectronRendererClient::environments_
refactor: use base::flat_set for ElectronRendererClient::injected_frames_
* refactor: use base::flat_set for WebWorkerObserver::environments_
* feat: add transparent option to WebContents
* feat: add transparent attribute to webview
* test: add tests for webview transparent attribute
* docs: add transparent attribute to webview docs
* fix: run tests on macOS only
* refactor: remove unneeded html tag
* fix: only apply transparent option to guests
* refactor: correct comment
* refactor: use opaque instead
Retains current webview behaviour by default.
* fix: correct variable name to guest_opaque_
* refactor: use transparent webpreference
* docs: remove unused web preference
* fix: uncomment condition for transparency test
* docs: converted to list format and linked to MDN
* fix: make webviews transparent by default again
* fix: rebase error
---------
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
* chore: initial prototype of net api from utility process
* chore: update url loader to work on both browser and utility processes
* chore: add net files to utility process bundle
* chore: re-add app ready check but only on main process
* chore: replace browser thread dcheck's with sequence checker
* refactor: move url loader from browser to common
* refactor: move net-client-request.ts from browser to common
* docs: add utility process to net api docs
* refactor: move net module app ready check to browser only
* refactor: switch import from main to common after moving to common
* test: add basic net module test for utility process
* refactor: switch browser pid with utility pid
* refactor: move electron_api_net from browser to common
* chore: add fetch to utility net module
* chore: add isOnline and online to utility net module
* refactor: move net spec helpers into helper file
* refactor: break apart net module tests
Adds two additional net module test files: `api-net-session-spec.ts` for
tests that depend on a session being available (aka depend on running on
the main process) and `api-net-custom-protocols-spec.ts` for custom
protocol tests. This enables running `api-net-spec.ts` in the utility
process.
* test: add utility process mocha runner to run net module tests
* docs: add utility process to net module classes
* refactor: update imports in lib/utility to use electron/utility
* chore: check browser context before using in main process
Since the browser context supplied to the SimpleURLLoaderWrapper can now
be null for use in the UtilityProcess, adding a null check for the main
process before use to get a more sensible error if something goes wrong.
Co-authored-by: Cheng Zhao <github@zcbenz.com>
* chore: remove test debugging
* chore: remove unnecessary header include
* docs: add utility process net module limitations
* test: run net module tests in utility process individually
* refactor: clean up prior utility process net tests
* chore: add resolveHost to utility process net module
* chore: replace resolve host dcheck with sequence checker
* test: add net module tests for net.resolveHost
* docs: remove utility process limitation for resolveHost
---------
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Cheng Zhao <github@zcbenz.com>
* chore: bump chromium in DEPS to 121.0.6154.0
* chore: bump chromium in DEPS to 121.0.6155.0
* fix patches
* chore: update patches
* patch out reference to GetOcclusionTracker
* un-flag PIPOcclusionTracker
* chore: bump chromium in DEPS to 121.0.6157.0
* fix conflicts
https://chromium-review.googlesource.com/c/chromium/src/+/5038807
* add PIP occlusion tracker sources to chromium_src
* 5037591: Replace feature_list's Initialize* methods with Init*.
https://chromium-review.googlesource.com/c/chromium/src/+/5037591
* 4811903: Move //content/browser/renderer_host/input/synthetic_gesture_controller to //content/common/input
https://chromium-review.googlesource.com/c/chromium/src/+/4811903
* 4917953: usb: Add usb-unrestricted to permission policy
https://chromium-review.googlesource.com/c/chromium/src/+/4917953
* 5072395: Remove unused `creation_context` parameter from blink/public APIs
https://chromium-review.googlesource.com/c/chromium/src/+/5072395
* 5052035: [X11] Change AtomCache from a singleton to owned by Connection
https://chromium-review.googlesource.com/c/chromium/src/+/5052035
* fix v8/.patches
* node script/gen-libc++-filenames.js
* 5035771: Remove the SetImage method of ImageButton
https://chromium-review.googlesource.com/c/chromium/src/+/5035771
* fixup! 5052035: [X11] Change AtomCache from a singleton to owned by Connection
* fixup! 5035771: Remove the SetImage method of ImageButton
* chore: bump chromium in DEPS to 121.0.6159.0
* 4505903: [Extensions] Add lastAccessed property to chrome.tabs.Tab
https://chromium-review.googlesource.com/c/chromium/src/+/4505903
* update patches
* don't duplicate tabs API types
this causes weird memory bugs if the two get out of sync
* fix UAF in TrayIconCocoa
not sure why this is popping up just now ... this has been broken for ages afaict
* Revert "don't duplicate tabs API types"
This reverts commit 80dff2efaa1297e5c191b2c69648099d6665dbff.
This is failing tests with extensions API schema check failures, so
revert for now. we'll fix it later.
* revert v8 change causing node crashes
* chore: reduce diffs in revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>