mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
65c59dd796
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