mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-01 16:02:53 +00:00
LibWeb+LibWebView+WebContent: Add a new IPC for modifying history state
Let's not re-invoke the "page did start loading" IPC when the history state is pushed/replaced. It's a bit misleading (the change does not actually load the new URL), but also the chromes may do more work than we want when we change the URL. Instead, add a new IPC for the history object to invoke.
This commit is contained in:
parent
1767f405dc
commit
8b1ad5c496
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/trflynn89
Commit: 8b1ad5c496
Pull-request: https://github.com/SerenityOS/serenity/pull/23758
Reviewed-by: https://github.com/kalenikaliaksandr ✅
9 changed files with 31 additions and 3 deletions
|
@ -76,6 +76,21 @@ void WebContentClient::did_finish_loading(u64 page_id, URL::URL const& url)
|
|||
view.on_load_finish(url);
|
||||
}
|
||||
|
||||
void WebContentClient::did_update_url(u64 page_id, URL::URL const& url, Web::HTML::HistoryHandlingBehavior history_behavior)
|
||||
{
|
||||
auto maybe_view = m_views.get(page_id);
|
||||
if (!maybe_view.has_value()) {
|
||||
dbgln("Received finish loading for unknown page ID {}", page_id);
|
||||
return;
|
||||
}
|
||||
auto& view = *maybe_view.value();
|
||||
|
||||
view.set_url({}, url);
|
||||
|
||||
if (view.on_url_updated)
|
||||
view.on_url_updated(url, history_behavior);
|
||||
}
|
||||
|
||||
void WebContentClient::did_finish_text_test(u64 page_id)
|
||||
{
|
||||
auto maybe_view = m_views.get(page_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue