RESOLVED FIXED 226323
REGRESSION (iOS 14.5): Can't go back and render previous page properly after "location.href"
https://bugs.webkit.org/show_bug.cgi?id=226323
Summary REGRESSION (iOS 14.5): Can't go back and render previous page properly after ...
Okamoto Takuya
Reported 2021-05-27 03:18:19 PDT
Created attachment 429863 [details] reproducing steps # Reproducible environment - Safari and Webview on iOS 14.5 - Safari 14.1 on Mac 10.15 # Reproducing steps Please see the attached video, too. 1. Access to SiteA located in "https://siteA.com/" 2. In SiteA, run JS code like this immediately: ``` <script type="text/javascript"> location.href="https://siteB.com/" // SiteB </script> ``` This page of SiteA won’t be recorded in the browser’s history since this "location.href" is called without user interactions. https://html.spec.whatwg.org/multipage/history.html#location-object-setter-navigate 3. After arriving at SiteB, click browser's history back button to go back to SiteA 4. I expected to see the page before SiteA, but the issue below occurs # Issue Even though the browser's URL bar shows SiteA's URL, but I can't see SiteA contents because: - The browser shows a blank screen instead (iOS) - Or, the browser keeps and shows previous page's contents of SiteA (Mac) ## Note - When SiteA and SiteB are on a same domain, this issue isn't reproduced. - Sometimes the issue won't occur anymore after accessing SiteA multiple times. In that case, once clear the browser cache, you can reproduce it again. # Reproducible page page: https://redirect-issue.web.app code: https://github.com/cola119/safari-redirect-issue
Attachments
reproducing steps (4.85 MB, video/quicktime)
2021-05-27 03:18 PDT, Okamoto Takuya
no flags
Patch (5.97 KB, patch)
2021-05-28 14:43 PDT, Alex Christensen
no flags
Patch (7.90 KB, patch)
2021-06-01 09:06 PDT, Chris Dumez
no flags
Alexey Proskuryakov
Comment 1 2021-05-27 18:17:24 PDT
Thank you for the report! > - Safari and Webview on iOS 14.5 > - Safari 14.1 on Mac 10.15 Could you please confirm if these are the first versions where this happens, and earlier ones worked as expected?
Okamoto Takuya
Comment 2 2021-05-27 19:22:52 PDT
(In reply to Alexey Proskuryakov from comment #1) > Could you please confirm if these are the first versions where this happens, > and earlier ones worked as expected? Thank you for your reply. Regarding iOS, we confirmed that we couldn't reproduce the issue in iOS 14.4 and earlier. Regarding Mac, we don't have many environments, so we could check only on Safari 14.1 in Mac 10.15.
Alexey Proskuryakov
Comment 3 2021-05-28 10:33:53 PDT
Thank you, this is what we need to know about regression story. I should have asked right away about customer impact. Does this affect specific existing websites and/or apps? How bad is the impact?
Radar WebKit Bug Importer
Comment 4 2021-05-28 10:34:09 PDT
Alex Christensen
Comment 5 2021-05-28 11:58:26 PDT
This worked before r269170 which caused the web process to crash when pushing the back button. When that crash was fixed in r270789 it no longer showed the previous page when pushing the back button.
Alex Christensen
Comment 6 2021-05-28 14:43:07 PDT
Okamoto Takuya
Comment 7 2021-05-30 18:52:17 PDT
(In reply to Alexey Proskuryakov from comment #3) Thank you for your confirmation! > I should have asked right away about customer impact. Does this affect specific existing websites and/or apps? How bad is the impact? We offer the platform to our customers and this issue affects to one feature of it. We have a redirector which was made with "location.href" and can pass path/query/fragment from original access. It means: Click the link to SiteA (a redirector) with path/query/fragment -> Site A redirect to Site B (different domain) with the passed path/query/fragment -> Land at Site B with the passed path/query/fragment In the way of redirecting with HTTP status code 301/302, we can't pass fragment to the final destination since server side can't recognize fragment in URL. Therefore we use "location.href" since JS can recognize it.
Chris Dumez
Comment 8 2021-06-01 09:06:42 PDT
EWS
Comment 9 2021-06-01 12:02:45 PDT
Committed r278318 (238354@main): <https://commits.webkit.org/238354@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430266 [details].
Note You need to log in before you can comment on or make changes to this bug.