• Mustafa Emre Acer's avatar
    Lookalikes: Properly handle interstitial reloads · 52bc9b90
    Mustafa Emre Acer authored
    When the lookalike URL interstitial stops a redirect, reloading it navigates to
    the end of the redirect chain which hides the interstitial.
    
    In order to prevent this, this CL stores the parameters of the interstitial
    (URL, redirect chain and referrer) as WebContentsUserData. On page reload,
    the throttle retrieves the parameters and checks if the currently navigated URL
    is at the end of the stored redirect chain. If so, it cancels the current
    navigation (the reload) and navigates back to the original lookalike URL that
    triggered the interstitial.
    
    As a result, a reload will end up with the same
    interstitial as before. The throttle immediately clears stored interstitial
    parameters after it retrieves them, so that unrelated navigations (to a
    different URL, or initiated directly by the user) don't re-trigger the
    interstitial.
    
    Bug: 941886
    Change-Id: If37802815f296bf534d7fb3b54fe96813d1659d7
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715759
    Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
    Reviewed-by: default avatarJoe DeBlasio <jdeblasio@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#682093}
    52bc9b90
reputation_service.cc 4.68 KB