mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibWeb: Convert the Navigator object to ThrowCompletionOr
This commit is contained in:
parent
0f93c9d6c8
commit
19ac19eae1
Notes:
sideshowbarker
2024-07-18 01:41:37 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/19ac19eae16 Pull-request: https://github.com/SerenityOS/serenity/pull/10727 Reviewed-by: https://github.com/linusg ✅
@ -33,8 +33,8 @@ void NavigatorObject::initialize(JS::GlobalObject& global_object)
|
||||
define_direct_property("platform", js_string(heap, "SerenityOS"), attr);
|
||||
define_direct_property("product", js_string(heap, "Gecko"), attr);
|
||||
|
||||
define_old_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||
define_old_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||
define_native_accessor("userAgent", user_agent_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||
define_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||
|
||||
// FIXME: Reflect actual connectivity status.
|
||||
define_direct_property("onLine", JS::Value(true), attr);
|
||||
@ -44,12 +44,12 @@ NavigatorObject::~NavigatorObject()
|
||||
{
|
||||
}
|
||||
|
||||
JS_DEFINE_OLD_NATIVE_FUNCTION(NavigatorObject::user_agent_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::user_agent_getter)
|
||||
{
|
||||
return JS::js_string(vm, ResourceLoader::the().user_agent());
|
||||
}
|
||||
|
||||
JS_DEFINE_OLD_NATIVE_FUNCTION(NavigatorObject::cookie_enabled_getter)
|
||||
JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::cookie_enabled_getter)
|
||||
{
|
||||
// No way of disabling cookies right now :^)
|
||||
return JS::Value(true);
|
||||
|
@ -21,8 +21,8 @@ public:
|
||||
virtual ~NavigatorObject() override;
|
||||
|
||||
private:
|
||||
JS_DECLARE_OLD_NATIVE_FUNCTION(user_agent_getter);
|
||||
JS_DECLARE_OLD_NATIVE_FUNCTION(cookie_enabled_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(user_agent_getter);
|
||||
JS_DECLARE_NATIVE_FUNCTION(cookie_enabled_getter);
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user