| Index: ios/web/web_state/ui/crw_web_controller.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
|
| index 6c926c06c7b6927f29403a948152e5f75f48c778..be0d8c44789dcac79a215e5d5686b6649ad04105 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -3343,6 +3343,17 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| if ([self isMainFrameNavigationAction:action])
|
| [self stopLoading];
|
|
|
| + // Purge web view if last committed URL is different from the document URL.
|
| + // This can happen if external URL was added to the navigation stack and was
|
| + // loaded using Go Back or Go Forward navigation (in which case document URL
|
| + // will point to the previous page).
|
| + GURL lastCommittedURL =
|
| + self.webState->GetNavigationManager()->GetLastCommittedItem()->GetURL();
|
| + if (lastCommittedURL != _documentURL) {
|
| + [self requirePageReconstruction];
|
| + [self setDocumentURL:lastCommittedURL];
|
| + }
|
| +
|
| if ([_delegate openExternalURL:requestURL
|
| linkClicked:isNavigationTypeLinkActivated]) {
|
| // Record the URL so that errors reported following the 'NO' reply can be
|
|
|