Commit b903eefb authored by Kevin McNee's avatar Kevin McNee Committed by Chromium LUCI CQ

Don't CHECK on MimeHandlerViews navigating to about:blank

We recently added a CHECK that MimeHandlerViews can't navigate away from
their handling extension. However, attempting to perform a lighthouse
audit of the PDF viewer causes it to navigate to about:blank.

While this is still a bug, we no longer CHECK in response to about:blank.

Bug: 1168046, 1158381
Change-Id: I84f137cffb1dbf6173bd6ad53d7bf24703acba3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2637404Reviewed-by: default avatarLucas Gadani <lfg@chromium.org>
Commit-Queue: Kevin McNee <mcnee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#845283}
parent 0bdfacd2
......@@ -446,13 +446,17 @@ void MimeHandlerViewGuest::ReadyToCommitNavigation(
void MimeHandlerViewGuest::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
guest_view::GuestView<MimeHandlerViewGuest>::DidFinishNavigation(
navigation_handle);
if (navigation_handle->IsInMainFrame()) {
// We should not navigate the guest away from the handling extension.
const url::Origin handler_origin =
url::Origin::Create(stream_->handler_url());
const url::Origin new_origin =
url::Origin::Create(navigation_handle->GetURL());
CHECK(new_origin.IsSameOriginWith(handler_origin));
const GURL& new_url = navigation_handle->GetURL();
const url::Origin new_origin = url::Origin::Create(new_url);
CHECK(new_origin.IsSameOriginWith(handler_origin) ||
new_url.IsAboutBlank());
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment