Files
electron/patches/chromium/.patches
T
Samuel AttardandClaude 0edcdc47c0 feat: add app shims on macOS (#54932)
* feat: add app shims on macOS

An app shim is a small app, in a bundle of its own, that shows windows on
behalf of a host Electron app. The host still creates each window, loads
its page and handles its events, but the NSWindow belongs to the shim's
process, so the Dock, the app switcher, Mission Control and Stage Manager
attribute the window to the shim and not to the host.

- `app.startAppShimServer()` / `app.stopAppShimServer()` and the
  `app-shim-connected` event, which hands over an `AppShimHost`.
- A `BaseWindow` / `BrowserWindow` created with the `appShim` option has
  its native window made in that shim's process, through Chromium's
  remote_cocoa. Such a window is a new NativeWindow implementation that
  only goes through views::Widget; what remote_cocoa has no call for is
  a no-op (see docs/api/app-shim-host.md).
- The shim's executable is `Helpers/app_shim_loader` from the framework
  bundle. It links nothing from Electron: it loads the host's framework
  and calls the new `ElectronAppShimMain` export, which runs an
  `app-shim` process that connects back to the host over a Mach
  bootstrap server.
- Electron Framework gains an rpath to the folder it is in, so that it
  finds its sibling frameworks when an executable in another bundle
  loads it.

Not available in Mac App Store builds.

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: app shim menus, dialogs, window chrome and review fixes

Follow-up to the first app shim commit.

Fixes from review:
- A window torn down from one of its own listeners (shim.quit() or
  win.destroy() in `show`) no longer frees the native host that is
  notifying.
- The native close button no longer leaves the shim waiting on an answer
  that was dropped with the window.
- Keys the page does not handle go back to the shim, whose menu they are
  shortcuts of, and not to the host's menu.
- stopAppShimServer() drops shims that have connected and not said hello.
- Quitting a shim asks the host without blocking and without cancelling a
  logout; quit-requested can now be answered with "no".
- Size limits and useContentSize are in content sizes; restore() and
  unmaximize() each do one thing; webContents.isFocused() works.

New:
- shim.setMenu(): a menu bar of the shim's own, built in the shim from a
  description of the Menu, with clicks sent back.
- Message boxes and open and save dialogs are sheets of the window in the
  shim's process.
- titleBarStyle, traffic light position and visibility, vibrancy, tabs and
  Quick Look, applied in the shim to the NSWindow that remote_cocoa made.
- A Chromium patch for what remote_cocoa has no call for: movable,
  closable, minimizable and fullscreenable, clearing an aspect ratio, and
  yielding activation to the hosting process by pid.
- A shim that loaded another build of Electron than the running host
  tells the host and quits: app-shim-version-mismatch.

The API is marked experimental in the docs.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: address review of app shims

- A window in an app shim can't be given a parent, at construction or
  with setParentWindow(), as the docs say.
- shim.setMenu() is now shim.setApplicationMenu().
- A message box that is showing under an id makes way for a new one with
  that id, whichever process shows it.
- Mac App Store builds no longer export the shim's entry point; they
  already had no loader.
- setProgressBar() and setHasShadow() are listed among what does nothing
  on a window in a shim.
- The spec no longer asserts inside an event listener.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: clang-tidy findings in app shim code

* docs: reword the app shim docs for clarity

* chore: update patches

Re-exported after rebasing onto Chromium 158.0.8105.0; only line offsets
changed.

Co-Authored-By: Claude <noreply@anthropic.com>

* test: use vitest matchers in the app shim spec

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-16 14:03:19 -07:00

142 lines
7.0 KiB
Plaintext

build_gn.patch
build_resolve_pgo_profiles_from_electron_state_files.patch
accelerator.patch
blink_local_frame.patch
can_create_window.patch
disable_hidden.patch
dom_storage_limits.patch
render_widget_host_view_mac.patch
gin_enable_disable_v8_platform.patch
enable_reset_aspect_ratio.patch
boringssl_build_gn.patch
gtk_visibility.patch
resource_file_conflict.patch
scroll_bounce_flag.patch
mas_avoid_private_macos_api_usage.patch.patch
add_didinstallconditionalfeatures.patch
desktop_media_list.patch
proxy_config_monitor.patch
gritsettings_resource_ids.patch
isolate_holder.patch
notification_provenance.patch
command-ismediakey.patch
printing.patch
support_mixed_sandbox_with_zygote.patch
build_add_electron_tracing_category.patch
worker_context_will_destroy.patch
frame_host_manager.patch
network_service_allow_remote_certificate_verification_logic.patch
picture-in-picture.patch
disable_compositor_recycling.patch
allow_new_privileges_in_unsandboxed_child_processes.patch
expose_setuseragent_on_networkcontext.patch
add_webmessageportconverter_entangleandinjectmessageportchannel.patch
ignore_rc_check.patch
allow_disabling_blink_scheduler_throttling_per_renderview.patch
hack_plugin_response_interceptor_to_point_to_electron.patch
feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
feat_enable_offscreen_rendering_with_viz_compositor.patch
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
allow_in-process_windows_to_have_different_web_prefs.patch
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
adjust_accessibility_ui_for_electron.patch
worker_feat_add_hook_to_notify_script_ready.patch
fix_export_zlib_symbols.patch
web_contents.patch
webview_fullscreen.patch
build_libc_as_static_library.patch
logging_win32_only_create_a_console_if_logging_to_stderr.patch
fix_media_key_usage_with_globalshortcuts.patch
feat_surface_global_shortcut_registration_results_to_embedders.patch
feat_expose_raw_response_headers_from_urlloader.patch
process_singleton.patch
feat_add_data_parameter_to_processsingleton.patch
fix_adapt_exclusive_access_for_electron_needs.patch
fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch
build_make_libcxx_abi_unstable_false_for_electron.patch
make_gtk_getlibgtk_public.patch
custom_protocols_plzserviceworker.patch
feat_filter_out_non-shareable_windows_in_the_current_application_in.patch
short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
chore_add_electron_deps_to_gitignores.patch
chore_modify_chromium_handling_of_mouse_events.patch
add_electron_deps_to_license_credits_file.patch
fix_crash_loading_non-standard_schemes_in_iframes.patch
feat_configure_launch_options_for_service_process.patch
feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch
fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch
fix_remove_caption-removing_style_call.patch
build_allow_electron_to_use_exec_script.patch
chore_introduce_blocking_api_for_electron.patch
chore_patch_out_partition_attribute_dcheck_for_webviews.patch
chore_patch_out_profile_methods.patch
refactor_expose_hostimportmoduledynamically_and.patch
feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch
fix_disabling_background_throttling_in_compositor.patch
fix_select_the_first_menu_item_when_opened_via_keyboard.patch
fix_return_v8_value_from_localframe_requestexecutescript.patch
fix_use_delegated_generic_capturer_when_available.patch
expose_webblob_path_to_allow_embedders_to_get_file_paths.patch
fix_move_autopipsettingshelper_behind_branding_buildflag.patch
revert_remove_the_allowaggressivethrottlingwithwebsocket_feature.patch
feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch
chore_remove_check_is_test_on_script_injection_tracker.patch
refactor_expose_file_system_access_blocklist.patch
feat_add_support_for_missing_dialog_features_to_shell_dialogs.patch
chore_remove_reference_to_chrome_browser_themes.patch
build_allow_electron_mojom_interfaces_to_depend_on_blink.patch
osr_shared_texture_remove_keyed_mutex_on_win_dxgi.patch
feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
chore_partial_revert_of.patch
fix_adjust_headless_mode_handling_in_native_widget.patch
refactor_unfilter_unresponsive_events.patch
feat_corner_smoothing_css_rule_and_blink_painting.patch
build_add_public_config_simdutf_config.patch
fix_handle_embedder_windows_shown_after_webcontentsviewcocoa_attach.patch
feat_separate_content_settings_callback_for_sync_and_async_clipboard.patch
fix_win32_synchronous_spellcheck.patch
chore_grandfather_in_electron_views_and_delegates.patch
refactor_patch_electron_permissiontypes_into_blink.patch
fix_resolve_dynamic_background_material_update_issue_on_windows_11.patch
feat_add_support_for_embedder_snapshot_validation.patch
chore_expose_isolate_parameter_in_script_lifecycle_observers.patch
expose_referrerscriptinfo_hostdefinedoptionsindex.patch
fix_check_for_file_existence_before_setting_mtime.patch
fix_linux_tray_id.patch
expose_gtk_ui_platform_field.patch
patch_osr_control_screen_info.patch
refactor_allow_customizing_config_in_freedesktopsecretkeyprovider.patch
fix_set_correct_app_id_on_linux.patch
allow_electron_visibility_for_cdm_renderer.patch
fix_use_fresh_lazynow_for_onendworkitemimpl_after_didruntask.patch
fix_pulseaudio_stream_and_icon_names.patch
feat_allow_enabling_extensions_on_custom_protocols.patch
fix_initialize_com_on_desktopmedialistcapturethread_on_windows.patch
chore_register_node_as_a_dynamic_trace_category_prefix.patch
fix_make_macos_text_replacement_work_on_contenteditable.patch
fix_use_bundled_devtools_frontend_url_for_remote_debugging.patch
fix_constrain_allowuniversalaccessfromfileurls_to_file_origins_in.patch
fix_add_reinitializegeneratedcodecachecontext_to.patch
feat_carry_embedder_startup_data_in_createnewwindowreply.patch
feat_deliver_service_worker_preload_data_via_embeddedworkerstartparams.patch
build_allow_resource_allowlist_generation_for_linux_and_macos.patch
fix_guard_webstoreprivateapi_factory_against_null_delegate.patch
allow_authenticator_responses_to_override_client_data_json.patch
remove_cr_xcode_build_define_from_build_gn.patch
chore_add_to_ubsan_ignorelists.patch
fix_fall_back_to_an_unlocalized_touch_id_prompt_reason_when_the.patch
revert_only_preload_swiftshader_in_gpu_sandbox_init_when_allowed.patch
fix_use_a_private_d-bus_connection_for_each_status_icon.patch
webhid_webusb_pass_the_frame_to_canrequestdevicepermission.patch
webhid_webusb_key_document_services_on_the_requesting_frame_s_origin.patch
build_restore_allow_runtime_configurable_key_storage_arg.patch
fix_restore_snap-compatible_dbusmenu_object_path.patch
fix_allow_any_exit_code_in_browsermainrunner_setoverrideresultcode.patch
gin_copy_ascii_one-byte_strings_out_directly_in.patch
fix_gate_webstoreprivate_on_a_delegated_availability_check.patch
build_drop_the_unused_chrome_browser_win_dep_from_color_mixers.patch
fix_plumb_the_requesting_frame_through_pointer_lock_requests.patch
fix_avoid_misaligned_char16_t_reads_in_crdtp_string_deserialization.patch
feat_let_the_host_of_a_remote_nswindow_set_more_of_its_behavior.patch