mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
LibWeb: Support navigator.javaEnabled() (always false)
This removes exception spam about javaEnabled() on apple.com.
This commit is contained in:
parent
0e806f58fe
commit
2a8c6361aa
2 changed files with 10 additions and 0 deletions
|
@ -36,6 +36,8 @@ void NavigatorObject::initialize(JS::GlobalObject& global_object)
|
||||||
define_native_accessor("userAgent", user_agent_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);
|
define_native_accessor("cookieEnabled", cookie_enabled_getter, {}, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||||
|
|
||||||
|
define_native_function("javaEnabled", java_enabled, 0, JS::Attribute::Configurable | JS::Attribute::Enumerable);
|
||||||
|
|
||||||
// FIXME: Reflect actual connectivity status.
|
// FIXME: Reflect actual connectivity status.
|
||||||
define_direct_property("onLine", JS::Value(true), attr);
|
define_direct_property("onLine", JS::Value(true), attr);
|
||||||
}
|
}
|
||||||
|
@ -51,6 +53,13 @@ JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::cookie_enabled_getter)
|
||||||
return JS::Value(true);
|
return JS::Value(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-javaenabled
|
||||||
|
JS_DEFINE_NATIVE_FUNCTION(NavigatorObject::java_enabled)
|
||||||
|
{
|
||||||
|
// The NavigatorPlugins mixin's javaEnabled() method steps are to return false.
|
||||||
|
return JS::Value(false);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ public:
|
||||||
private:
|
private:
|
||||||
JS_DECLARE_NATIVE_FUNCTION(user_agent_getter);
|
JS_DECLARE_NATIVE_FUNCTION(user_agent_getter);
|
||||||
JS_DECLARE_NATIVE_FUNCTION(cookie_enabled_getter);
|
JS_DECLARE_NATIVE_FUNCTION(cookie_enabled_getter);
|
||||||
|
JS_DECLARE_NATIVE_FUNCTION(java_enabled);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue