Browse Source

LibWeb: Extract out the User-Agent browser name and version

This way we can re-use these elsewhere, and if they ever change again,
those other uses will get updated automatically.
Timothy Flynn 2 years ago
parent
commit
021eb04640
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Userland/Libraries/LibWeb/Loader/ResourceLoader.h

+ 4 - 1
Userland/Libraries/LibWeb/Loader/ResourceLoader.h

@@ -44,7 +44,10 @@ namespace Web {
 #    error Unknown OS
 #endif
 
-constexpr auto default_user_agent = "Mozilla/5.0 (" OS_STRING "; " CPU_STRING ") LibWeb+LibJS/1.0 Ladybird/1.0"sv;
+#define BROWSER_NAME "Ladybird"
+#define BROWSER_VERSION "1.0"
+
+constexpr auto default_user_agent = "Mozilla/5.0 (" OS_STRING "; " CPU_STRING ") LibWeb+LibJS/1.0 " BROWSER_NAME "/" BROWSER_VERSION ""sv;
 
 class ResourceLoaderConnectorRequest : public RefCounted<ResourceLoaderConnectorRequest> {
 public: