Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e48835c9f88ca0cbd1631947517b36a7c4c03e39
https://github.com/WebKit/WebKit/commit/e48835c9f88ca0cbd1631947517b36a7c4c03e39
Author: Jessica Lee <[email protected]>
Date: 2026-04-17 (Fri, 17 Apr 2026)
Changed paths:
M Source/WebCore/loader/ContentFilter.cpp
M Source/WebCore/loader/ContentFilter.h
M Source/WebCore/loader/DocumentLoader.cpp
M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Log Message:
-----------
ParentalControls Filters may accidentally vend an iframe shield instead of a
mainframe shield.
https://bugs.webkit.org/show_bug.cgi?id=312552
rdar://173774144
Reviewed by Per Arne Vollan.
ParentalControls Filters may accidentally vend an iframe shield instead of a
mainframe shield.
We use the criteria that the current mainFrameURL is null to determine whether
or not we have an
iframe or a mainframe. This worked for the most part because Parental Controls
testing was done with
URLs that trigger process swaps because the scheme of the blocked page is
different. In that situation,
we start with a brand new, null mainFrameURL as the load has not been populated
yet. But in the case
where the same process is re-used, we still have the residual, populated
mainFrameURL and so we vend
the iframe shield instead.
The code currently assumes that mainFrameURL will always be null on a fresh
navigation. This is wrong.
Instead, we fix the code to only populate the platform content filter's
mainDocumentURL if we are an
iframe and we use existing DocumentLoader/NetworkResourceLoader functionalities
to determine this.
No new tests needed.
* Source/WebCore/loader/ContentFilter.cpp:
(WebCore::ContentFilter::create):
* Source/WebCore/loader/ContentFilter.h:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startContentFiltering):
Canonical link: https://commits.webkit.org/311515@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications