mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibWeb: Convert the Navigator object to ThrowCompletionOr
This commit is contained in:
parent
0f93c9d6c8
commit
19ac19eae1
2 changed files with 6 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue