https://bugs.webkit.org/show_bug.cgi?id=150261
Reviewed by Brady Eidson.
This fix was tested manually by reloading without content blockers
on websites with iframes and content blockers that block the contents of the iframes.
* page/UserContentController.cpp:
(WebCore::UserContentController::removeAllUserContentExtensions):
(WebCore::contentExtensionsEnabled):
(WebCore::UserContentController::processContentExtensionRulesForLoad):
(WebCore::UserContentController::actionsForResourceLoad):
Check the DocumentLoader of the main frame when checking if content extensions are disabled,
because that is the DocumentLoader that has the flag from reloading without content blockers.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191223
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-10-16 Alex Christensen <achristensen@webkit.org>
+
+ Disabled content blockers should not block any loads
+ https://bugs.webkit.org/show_bug.cgi?id=150261
+
+ Reviewed by Brady Eidson.
+
+ This fix was tested manually by reloading without content blockers
+ on websites with iframes and content blockers that block the contents of the iframes.
+
+ * page/UserContentController.cpp:
+ (WebCore::UserContentController::removeAllUserContentExtensions):
+ (WebCore::contentExtensionsEnabled):
+ (WebCore::UserContentController::processContentExtensionRulesForLoad):
+ (WebCore::UserContentController::actionsForResourceLoad):
+ Check the DocumentLoader of the main frame when checking if content extensions are disabled,
+ because that is the DocumentLoader that has the flag from reloading without content blockers.
+
2015-10-16 Simon Fraser <simon.fraser@apple.com>
Make TextStream the canonical way to log classes in WebCore
2015-10-16 Simon Fraser <simon.fraser@apple.com>
Make TextStream the canonical way to log classes in WebCore
m_contentExtensionBackend->removeAllContentExtensions();
}
m_contentExtensionBackend->removeAllContentExtensions();
}
+static bool contentExtensionsEnabled(const DocumentLoader& documentLoader)
+{
+ if (auto frame = documentLoader.frame()) {
+ if (frame->isMainFrame())
+ return documentLoader.userContentExtensionsEnabled();
+ if (auto mainDocumentLoader = frame->mainFrame().loader().documentLoader())
+ return mainDocumentLoader->userContentExtensionsEnabled();
+ }
+
+ return true;
+}
+
ContentExtensions::BlockedStatus UserContentController::processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
{
if (!m_contentExtensionBackend)
return ContentExtensions::BlockedStatus::NotBlocked;
ContentExtensions::BlockedStatus UserContentController::processContentExtensionRulesForLoad(ResourceRequest& request, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader)
{
if (!m_contentExtensionBackend)
return ContentExtensions::BlockedStatus::NotBlocked;
- if (!initiatingDocumentLoader.userContentExtensionsEnabled())
+ if (!contentExtensionsEnabled(initiatingDocumentLoader))
return ContentExtensions::BlockedStatus::NotBlocked;
return m_contentExtensionBackend->processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
return ContentExtensions::BlockedStatus::NotBlocked;
return m_contentExtensionBackend->processContentExtensionRulesForLoad(request, resourceType, initiatingDocumentLoader);
if (!m_contentExtensionBackend)
return Vector<ContentExtensions::Action>();
if (!m_contentExtensionBackend)
return Vector<ContentExtensions::Action>();
- if (!initiatingDocumentLoader.userContentExtensionsEnabled())
+ if (!contentExtensionsEnabled(initiatingDocumentLoader))
return Vector<ContentExtensions::Action>();
return m_contentExtensionBackend->actionsForResourceLoad(resourceLoadInfo);
return Vector<ContentExtensions::Action>();
return m_contentExtensionBackend->actionsForResourceLoad(resourceLoadInfo);