1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 11:37:44 +00:00

LibWeb: Define navigator/clientInformation with define_native_accessor

Defining it as a direct property causes it to have no getter/setter
function, which causes an empty Optional crash when attempting to
access such getter on a cross-origin iframe.

Fixes amazon.com crashing on this particular crash.
This commit is contained in:
Luke Wilde 2023-02-28 01:08:49 +00:00 committed by Sam Atkins
parent f3d1be933a
commit 1c918e826c
2 changed files with 10 additions and 2 deletions

View file

@ -275,6 +275,8 @@ private:
JS_DECLARE_NATIVE_FUNCTION(crypto_getter);
JS_DECLARE_NATIVE_FUNCTION(navigator_getter);
#define __ENUMERATE(attribute, event_name) \
JS_DECLARE_NATIVE_FUNCTION(attribute##_getter); \
JS_DECLARE_NATIVE_FUNCTION(attribute##_setter);