From b2a6bf2a80fbc538b8f4b1fa3645cd65b0038658 Mon Sep 17 00:00:00 2001 From: WilliamKoza Date: Fri, 25 Jan 2019 21:45:46 +0100 Subject: [PATCH] fix(docs-infra): remove the try catch in the test of the browser's capacities (#28368) PR Close #28368 --- aio/src/app/shared/scroll.service.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/aio/src/app/shared/scroll.service.ts b/aio/src/app/shared/scroll.service.ts index d6086266f4..de48dcec68 100644 --- a/aio/src/app/shared/scroll.service.ts +++ b/aio/src/app/shared/scroll.service.ts @@ -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) {