Skip to content

Commit

Permalink
Merge pull request #8412 from brave/pr8389_mpilgrim_main_frame_1.23.x
Browse files Browse the repository at this point in the history
Fix for domain blocking iframes (uplift to 1.23.x)
  • Loading branch information
kjozwiak authored Apr 6, 2021
2 parents f6e5856 + 10c4b9a commit 0afaed2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ DomainBlockNavigationThrottle::WillStartRequest() {
if (!ad_block_service_->IsInitialized())
return content::NavigationThrottle::PROCEED;

// Don't bother checking non-HTTP(S) pages
// Don't block subframes
content::NavigationHandle* handle = navigation_handle();
if (!handle->IsInMainFrame())
return content::NavigationThrottle::PROCEED;

// Don't bother checking non-HTTP(S) pages
GURL request_url = handle->GetURL();
if (!request_url.SchemeIsHTTPOrHTTPS())
return content::NavigationThrottle::PROCEED;
Expand Down

0 comments on commit 0afaed2

Please sign in to comment.