mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Implement Navigator.cookieEnabled
This commit is contained in:
parent
a4bc3fa255
commit
c500ebdcd5
Notes:
sideshowbarker
2024-07-18 03:12:57 +09:00
Author: https://github.com/linusg
Commit: c500ebdcd5
Pull-request: https://github.com/SerenityOS/serenity/pull/10309
Reviewed-by: https://github.com/IdanHo ✅
2 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,7 @@ void NavigatorObject::initialize(JS::GlobalObject& global_object)
|
|||
define_direct_property("product", js_string(heap, "Gecko"), attr);
|
||||
|
||||
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);
|
||||
|
@ -48,6 +49,12 @@ JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::user_agent_getter)
|
|||
return JS::js_string(vm, ResourceLoader::the().user_agent());
|
||||
}
|
||||
|
||||
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