mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Add WindowObject::origin()
This is a convenience getter to retrieve the security origin of a DOM window's document.
This commit is contained in:
parent
618dcbe405
commit
b4a3537716
2 changed files with 8 additions and 0 deletions
|
@ -44,6 +44,7 @@
|
|||
#include <LibWeb/Bindings/XMLHttpRequestPrototype.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/Origin.h>
|
||||
|
||||
namespace Web {
|
||||
namespace Bindings {
|
||||
|
@ -93,6 +94,11 @@ void WindowObject::visit_children(Visitor& visitor)
|
|||
visitor.visit(m_xhr_prototype);
|
||||
}
|
||||
|
||||
Origin WindowObject::origin() const
|
||||
{
|
||||
return impl().document().origin();
|
||||
}
|
||||
|
||||
static DOM::Window* impl_from(JS::Interpreter& interpreter, JS::GlobalObject& global_object)
|
||||
{
|
||||
auto* this_object = interpreter.this_value(global_object).to_object(interpreter, global_object);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue