Remove the feature for hiding icons in native macOS popup dialogs

Commit: 5a8bf02a | 2025-04-23 15:12:35+00:00

← Back to List

Remove the feature for hiding icons in native macOS popup dialogs

Minor
Commit Hash: 5a8bf02a5db87e2745f0e9e4996921590462dec8
Commit Time: 2025-04-23 15:12:35+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review: View Upstream Review 🔗

📋 Summary

This submission removes the functionality for hiding the application icon in native macOS popup dialogs. The changes include: 1) deleting the hide_application_icon field from the AlertBridgeInitParams structure; 2) removing the setBlankIcon method and its related logic from alert.mm; 3) deleting the code in javascript_app_modal_dialog_cocoa.mm that sets the hide_application_icon flag based on dialog type. This change ensures that all dialogs will display the application icon, addressing the issue of excessive leading blank space caused by blank icons after the macOS 11 Big Sur redesign.

🎯 Impact Analysis

The impact of this change on WebView2Mac is positive and relatively minor. Since WebView2Mac relies on Remote Cocoa to handle native UI elements, including JavaScript popup dialogs, this change will affect the appearance of JavaScript alert, confirm, and prompt dialogs displayed in WebView2Mac. Specific impacts include: 1) All JavaScript dialogs triggered by WebView2Mac web content will now display the host application's icon instead of a blank icon; 2) This improves user experience, especially on macOS 11+ systems, by avoiding the large empty space caused by a blank icon; 3) The functional behavior of the dialogs remains completely unchanged, with only the visual appearance affected; 4) There is no impact on WebView2Mac's core functionality (web rendering, event handling, API interaction, etc.). This is a purely UI improvement that enhances the visual consistency of JavaScript dialogs within WebView2Mac applications.

Impacted Classes:

AlertBridge AlertBridgeHelper AlertBridgeInitParams