From a2b0cc8f08f5f082bbbf3f2c73cf8b2d2115ede9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 3 Apr 2020 18:10:20 +0200 Subject: [PATCH] LibWeb: Add "navigator" object and expose navigator.userAgent A lot of web content looks for this property. We'll probably have to tweak this as we go, but at least now we have it. :^) --- Base/home/anon/www/welcome.html | 9 +++- Libraries/LibWeb/Bindings/NavigatorObject.cpp | 48 +++++++++++++++++++ Libraries/LibWeb/Bindings/NavigatorObject.h | 45 +++++++++++++++++ Libraries/LibWeb/Bindings/WindowObject.cpp | 4 +- 4 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 Libraries/LibWeb/Bindings/NavigatorObject.cpp create mode 100644 Libraries/LibWeb/Bindings/NavigatorObject.h diff --git a/Base/home/anon/www/welcome.html b/Base/home/anon/www/welcome.html index 01a80d67f7..3084977afe 100644 --- a/Base/home/anon/www/welcome.html +++ b/Base/home/anon/www/welcome.html @@ -16,11 +16,18 @@ body { h1 { color: #a00; } +span#ua { + color: red; +} +

Welcome to the Serenity Browser!

-

This is a very simple browser built on the LibWeb engine.

+

This is a very simple browser built on the LibWeb and LibJS engines.

+

Your user agent is:

Some small test pages: