ladybird/Libraries/LibWeb/HTML/CrossOrigin/Reporting.h
Andreas Kling 2eea8894a1 LibWeb: Don't crash on named property access on detached window
In WindowProxy.[[Get]] it's not guaranteed that the current principal
global object has an associated document at the moment. This may happen
if a script is continuing to execute while a navigation has been
initiated.

Because of that, we can't blindly dereference the active document
pointer, so this patch adds a null check.
2025-05-30 10:13:25 +02:00

23 lines
610 B
C++

/*
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibJS/Forward.h>
#include <LibWeb/Forward.h>
namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/origin.html#accessor-accessed-relationship
enum class AccessorAccessedRelationship {
AccessorIsOpener,
AccessorIsOpenee,
None,
};
void check_if_access_between_two_browsing_contexts_should_be_reported(GC::Ptr<BrowsingContext const> accessor, GC::Ptr<BrowsingContext const> accessed, JS::PropertyKey const&, GC::Ref<EnvironmentSettingsObject const>);
}