mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibWeb: Only call page_did_change_title() from main frame
Otherwise an embedded iframe will override the page title in the browser, for example.
This commit is contained in:
parent
ae95ed5ddd
commit
c183ebc723
3 changed files with 9 additions and 5 deletions
|
@ -287,8 +287,10 @@ void Document::set_title(const String& title)
|
|||
|
||||
title_element->append_child(adopt(*new Text(*this, title)));
|
||||
|
||||
if (auto* page = this->page())
|
||||
page->client().page_did_change_title(title);
|
||||
if (auto* page = this->page()) {
|
||||
if (frame() == &page->main_frame())
|
||||
page->client().page_did_change_title(title);
|
||||
}
|
||||
}
|
||||
|
||||
void Document::attach_to_frame(Badge<Frame>, Frame& frame)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue