mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +00:00
LibWeb+WebContent: Label redirects with new FrameLoader::Type::Redirect
Previously we labeled redirects as normal FrameLoader::Type::Navigation, now we introduce a new FrameLoader::Type::Redirect and label redirects with it. This will allow us to handle redirects in the browser differently (such as for overwritting the latest history entry when a redirect happens) :^)
This commit is contained in:
parent
45a59b4d7e
commit
45214fdb1a
12 changed files with 16 additions and 15 deletions
|
@ -215,10 +215,10 @@ bool FrameLoader::load(LoadRequest& request, Type type)
|
|||
|
||||
auto& url = request.url();
|
||||
|
||||
if (type == Type::Navigation || type == Type::Reload) {
|
||||
if (type == Type::Navigation || type == Type::Reload || type == Type::Redirect) {
|
||||
if (auto* page = browsing_context().page()) {
|
||||
if (&page->top_level_browsing_context() == &m_browsing_context)
|
||||
page->client().page_did_start_loading(url);
|
||||
page->client().page_did_start_loading(url, type == Type::Redirect);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,7 @@ void FrameLoader::resource_did_load()
|
|||
return;
|
||||
}
|
||||
m_redirects_count++;
|
||||
load(url.complete_url(location.value()), FrameLoader::Type::Navigation);
|
||||
load(url.complete_url(location.value()), Type::Redirect);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue