mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(docs-infra): remove the try catch in the test of the browser's capacities (#28368)
PR Close #28368
This commit is contained in:
parent
0709f8411d
commit
b2a6bf2a80
1 changed files with 2 additions and 6 deletions
|
|
@ -49,12 +49,8 @@ export class ScrollService {
|
|||
fromEvent(window, 'scroll')
|
||||
.pipe(debounceTime(250)).subscribe(() => this.updateScrollPositionInHistory());
|
||||
|
||||
try {
|
||||
this.supportManualScrollRestoration = !!window && !!window.scrollTo && 'scrollX' in window
|
||||
&& 'scrollY' in window && !!history && !!history.scrollRestoration;
|
||||
} catch {
|
||||
this.supportManualScrollRestoration = false;
|
||||
}
|
||||
this.supportManualScrollRestoration = !!window && 'scrollTo' in window && 'scrollX' in window
|
||||
&& 'scrollY' in window && !!history && 'scrollRestoration' in history;
|
||||
|
||||
// Change scroll restoration strategy to `manual` if it's supported
|
||||
if (this.supportManualScrollRestoration) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue