mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00

This just sets up the infrastructure for the WebContent process to house WebDriver IPCs, and adds an IPC for WebContent to create the WebDriver connection. The WebDriverConnection class inside WebContent ultimately will contain most of what is currently in WebDriver::Session (so the copyright attributions are copied here as well). The socket created by WebDriver is currently /tmp/browser_webdriver (formatted with some IDs). This will be moved to the /tmp/webdriver folder, as WebDriver will create multiple sockets to communicate with both Browser and WebContent as the IPCs are iteratively moved to WebContent. That path is unveiled here, though it is unused as of this commit.
85 lines
4 KiB
Text
85 lines
4 KiB
Text
#include <AK/URL.h>
|
|
#include <LibIPC/File.h>
|
|
#include <LibCore/AnonymousBuffer.h>
|
|
#include <LibGfx/Rect.h>
|
|
#include <LibGfx/ShareableBitmap.h>
|
|
#include <LibWeb/CSS/PreferredColorScheme.h>
|
|
#include <LibWeb/CSS/Selector.h>
|
|
#include <LibWeb/WebDriver/ExecuteScript.h>
|
|
|
|
endpoint WebContentServer
|
|
{
|
|
connect_to_webdriver(String webdriver_ipc_path) =|
|
|
|
|
update_system_theme(Core::AnonymousBuffer theme_buffer) =|
|
|
update_system_fonts(String default_font_query, String fixed_width_font_query, String window_title_font_query) =|
|
|
update_screen_rects(Vector<Gfx::IntRect> rects, u32 main_screen_index) =|
|
|
|
|
load_url(URL url) =|
|
|
load_html(String html, URL url) =|
|
|
|
|
add_backing_store(i32 backing_store_id, Gfx::ShareableBitmap bitmap) =|
|
|
remove_backing_store(i32 backing_store_id) =|
|
|
|
|
paint(Gfx::IntRect content_rect, i32 backing_store_id) =|
|
|
set_viewport_rect(Gfx::IntRect rect) =|
|
|
|
|
mouse_down(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =|
|
|
mouse_move(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =|
|
|
mouse_up(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =|
|
|
mouse_wheel(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers, i32 wheel_delta_x, i32 wheel_delta_y) =|
|
|
doubleclick(Gfx::IntPoint position, unsigned button, unsigned buttons, unsigned modifiers) =|
|
|
|
|
key_down(i32 key, unsigned modifiers, u32 code_point) =|
|
|
key_up(i32 key, unsigned modifiers, u32 code_point) =|
|
|
|
|
debug_request(String request, String argument) =|
|
|
get_source() =|
|
|
serialize_source() => (String source)
|
|
inspect_dom_tree() =|
|
|
inspect_dom_node(i32 node_id, Optional<Web::CSS::Selector::PseudoElement> pseudo_element) => (bool has_style, String specified_style, String computed_style, String custom_properties, String node_box_sizing)
|
|
get_hovered_node_id() => (i32 node_id)
|
|
js_console_input(String js_source) =|
|
|
js_console_request_messages(i32 start_index) =|
|
|
|
|
get_document_element() => (Optional<i32> node_id)
|
|
query_selector_all(i32 start_node_id, String selector) => (Optional<Vector<i32>> elements_ids)
|
|
scroll_element_into_view(i32 element_id) => ()
|
|
is_element_selected(i32 element_id) => (bool selected)
|
|
get_element_attribute(i32 element_id, String name) => (Optional<String> attribute)
|
|
get_element_property(i32 element_id, String name) => (Optional<String> property)
|
|
get_active_documents_type() => (String type)
|
|
get_computed_value_for_element(i32 element_id, String property_name) => (String computed_value)
|
|
get_element_text(i32 element_id) => (String text)
|
|
get_element_tag_name(i32 element_id) => (String tag_name)
|
|
get_element_rect(i32 element_id) => (Gfx::IntRect rect)
|
|
is_element_enabled(i32 element_id) => (bool enabled)
|
|
take_element_screenshot(i32 element_id) => (Gfx::ShareableBitmap data)
|
|
take_document_screenshot() => (Gfx::ShareableBitmap data)
|
|
|
|
webdriver_execute_script(String body, Vector<String> json_arguments, Optional<u64> timeout, bool async) => (Web::WebDriver::ExecuteScriptResultType result_type, String json_result)
|
|
|
|
run_javascript(String js_source) =|
|
|
|
|
dump_layout_tree() => (String dump)
|
|
|
|
get_selected_text() => (String selection)
|
|
select_all() =|
|
|
|
|
set_content_filters(Vector<String> filters) =|
|
|
set_proxy_mappings(Vector<String> proxies, HashMap<String,size_t> mappings) =|
|
|
set_preferred_color_scheme(Web::CSS::PreferredColorScheme color_scheme) =|
|
|
set_has_focus(bool has_focus) =|
|
|
set_is_scripting_enabled(bool is_scripting_enabled) =|
|
|
set_is_webdriver_active(bool is_webdriver_active) =|
|
|
|
|
set_window_position(Gfx::IntPoint position) =|
|
|
set_window_size(Gfx::IntSize size) =|
|
|
|
|
get_local_storage_entries() => (OrderedHashMap<String,String> entries)
|
|
get_session_storage_entries() => (OrderedHashMap<String,String> entries)
|
|
|
|
handle_file_return(i32 error, Optional<IPC::File> file, i32 request_id) =|
|
|
|
|
set_system_visibility_state(bool visible) =|
|
|
}
|