Repository navigation
Conversation
In this commit, setting `window.history.scrollRestoration` is wrapped in a try-catch block to prevent `SecurityError` exceptions in restricted contexts such as: - sandboxed iframes - partially navigated or inactive windows - test runners, extensions, or content previews If an error occurs, a runtime warning with error code [2400] is logged to the console. This avoids breaking app initialization and improves cross-browser safety. Unfortunately, it's not possible to perform any end-to-end testing of this fix.
arturovt
commented
Jun 21, 2025
| formatRuntimeError( | ||
| RuntimeErrorCode.SCROLL_RESTORATION_UNSUPPORTED, | ||
| ngDevMode && | ||
| 'Failed to set `window.history.scrollRestoration`. ' + |
Contributor
Author
There was a problem hiding this comment.
@atscott as discussed in Slack -- let me know if this message needs to be updated.
thePunderWoman
requested review from
atscott
and removed request for
thePunderWoman
June 23, 2025 08:17
atscott
approved these changes
Jun 23, 2025
atscott
approved these changes
Jun 23, 2025
atscott
left a comment
Contributor
There was a problem hiding this comment.
reviewed-for: public-api
AndrewKushnir
approved these changes
Jun 23, 2025
AndrewKushnir
left a comment
Contributor
There was a problem hiding this comment.
Reviewed-for: public-api
thePunderWoman
pushed a commit
that referenced
this pull request
Jun 24, 2025
#62186) In this commit, setting `window.history.scrollRestoration` is wrapped in a try-catch block to prevent `SecurityError` exceptions in restricted contexts such as: - sandboxed iframes - partially navigated or inactive windows - test runners, extensions, or content previews If an error occurs, a runtime warning with error code [2400] is logged to the console. This avoids breaking app initialization and improves cross-browser safety. Unfortunately, it's not possible to perform any end-to-end testing of this fix. PR Close #62186
Contributor
|
This PR was merged into the repository by commit 7600bec. The changes were merged into the following branches: main, 20.0.x |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this commit, setting
window.history.scrollRestorationis wrapped in a try-catch block to preventSecurityErrorexceptions in restricted contexts such as:If an error occurs, a runtime warning with error code [2400] is logged to the console. This avoids breaking app initialization and improves cross-browser safety.
Unfortunately, it's not possible to perform any end-to-end testing of this fix.