LibWeb: Support Gecko and WebKit navigator compatibility modes

This will log a debug message when calls are made to the
NavigatorIDMixin that make decisions based on the compatibility mode.
This commit is contained in:
Jamie Mansfield 2024-07-02 01:04:40 +01:00 committed by Andreas Kling
commit 1128375dff
Notes: sideshowbarker 2024-07-17 07:35:03 +09:00
5 changed files with 105 additions and 11 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -53,10 +54,17 @@ namespace Web {
# error Unknown OS
#endif
enum class NavigatorCompatibilityMode {
Chrome,
Gecko,
WebKit
};
#define BROWSER_NAME "Ladybird"
#define BROWSER_VERSION "1.0"
constexpr auto default_user_agent = "Mozilla/5.0 (" OS_STRING "; " CPU_STRING ") " BROWSER_NAME "/" BROWSER_VERSION ""sv;
constexpr auto default_platform = OS_STRING " " CPU_STRING ""sv;
constexpr auto default_navigator_compatibility_mode = NavigatorCompatibilityMode::Chrome;
}