mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 21:17:44 +00:00
Ladybird: Add IPC call for creating a new child tab
This will be used for choosing a navigable that requires opening a new tab or new window. Such as calls to window.open(), or specific WebDriver calls.
This commit is contained in:
parent
7245f6f11c
commit
677bdc2a4f
17 changed files with 144 additions and 19 deletions
|
@ -497,9 +497,14 @@ void PageClient::page_did_update_resource_count(i32 count_waiting)
|
|||
client().async_did_update_resource_count(count_waiting);
|
||||
}
|
||||
|
||||
String PageClient::page_did_request_new_tab(Web::HTML::ActivateTab activate_tab)
|
||||
String PageClient::page_did_request_new_web_view(Web::HTML::ActivateTab activate_tab, Web::HTML::WebViewHints hints, Optional<u64> page_index)
|
||||
{
|
||||
return client().did_request_new_tab(activate_tab);
|
||||
auto response = client().send_sync_but_allow_failure<Messages::WebContentClient::DidRequestNewWebView>(activate_tab, hints, page_index);
|
||||
if (!response) {
|
||||
dbgln("WebContent client disconnected during DidRequestNewWebView. Exiting peacefully.");
|
||||
exit(0);
|
||||
}
|
||||
return response->take_handle();
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_activate_tab()
|
||||
|
|
|
@ -118,7 +118,7 @@ private:
|
|||
virtual void page_did_set_cookie(const URL&, Web::Cookie::ParsedCookie const&, Web::Cookie::Source) override;
|
||||
virtual void page_did_update_cookie(Web::Cookie::Cookie) override;
|
||||
virtual void page_did_update_resource_count(i32) override;
|
||||
virtual String page_did_request_new_tab(Web::HTML::ActivateTab activate_tab) override;
|
||||
virtual String page_did_request_new_web_view(Web::HTML::ActivateTab, Web::HTML::WebViewHints, Optional<u64> page_index = {}) override;
|
||||
virtual void page_did_request_activate_tab() override;
|
||||
virtual void page_did_close_browsing_context(Web::HTML::BrowsingContext const&) override;
|
||||
virtual void request_file(Web::FileRequest) override;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <LibWeb/CSS/Selector.h>
|
||||
#include <LibWeb/HTML/ActivateTab.h>
|
||||
#include <LibWeb/HTML/SelectItem.h>
|
||||
#include <LibWeb/HTML/WebViewHints.h>
|
||||
#include <LibWeb/Page/Page.h>
|
||||
#include <LibWebView/Attribute.h>
|
||||
#include <LibWebView/SocketPair.h>
|
||||
|
@ -58,7 +59,7 @@ endpoint WebContentClient
|
|||
did_set_cookie(URL url, Web::Cookie::ParsedCookie cookie, Web::Cookie::Source source) => ()
|
||||
did_update_cookie(Web::Cookie::Cookie cookie) =|
|
||||
did_update_resource_count(i32 count_waiting) =|
|
||||
did_request_new_tab(Web::HTML::ActivateTab activate_tab) => (String handle)
|
||||
did_request_new_web_view(Web::HTML::ActivateTab activate_tab, Web::HTML::WebViewHints hints, Optional<u64> page_index) => (String handle)
|
||||
did_request_activate_tab() =|
|
||||
did_close_browsing_context() =|
|
||||
did_request_restore_window() =|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue