mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
LibWeb/WebDriver: Handle WindowProxy in internal_json_clone_algorithm()
To test: ```console curl http://0.0.0.0:8000/session \ -H 'Content-Type: application/json' \ -d '{"capabilities": {}}' curl http://0.0.0.0:8000/session/0/execute/sync \ -H 'Content-Type: application/json' \ -d '{"script": "return window;", "args": []}' ``` Which should result in: ```json { "value": { "window-fcc6-11e5-b4f8-330a88ab9d7f": "86307df6-e2f1-4175-85cb-77295ff90898" } } ```
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/PropertyDescriptor.h>
|
||||
#include <LibJS/Runtime/PropertyKey.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/AbstractOperations.h>
|
||||
#include <LibWeb/HTML/CrossOrigin/Reporting.h>
|
||||
#include <LibWeb/HTML/Scripting/Environments.h>
|
||||
@@ -260,4 +261,9 @@ void WindowProxy::set_window(Badge<BrowsingContext>, JS::NonnullGCPtr<Window> wi
|
||||
m_window = window;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<BrowsingContext> WindowProxy::associated_browsing_context() const
|
||||
{
|
||||
return *m_window->associated_document().browsing_context();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user