mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 21:15:09 +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
|
@ -42,8 +42,10 @@ HTMLTitleElement::~HTMLTitleElement()
|
|||
void HTMLTitleElement::children_changed()
|
||||
{
|
||||
HTMLElement::children_changed();
|
||||
if (auto* page = document().page())
|
||||
page->client().page_did_change_title(document().title());
|
||||
if (auto* page = document().page()) {
|
||||
if (document().frame() == &page->main_frame())
|
||||
page->client().page_did_change_title(document().title());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue