Skip to content

Commit 11505fa

Browse files
committed
fix(aio): disable search on browsers that don't support web workers
1 parent 9326e06 commit 11505fa

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎aio/src/app/app.component.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,11 @@ export class AppComponent implements OnInit {
108108
) { }
109109

110110
ngOnInit() {
111-
this.searchService.initWorker('app/search/search-worker.js');
112-
this.searchService.loadIndex();
111+
// Do not initialize the search on browsers that lack web worker support
112+
if ('worker' in window) {
113+
this.searchService.initWorker('app/search/search-worker.js');
114+
this.searchService.loadIndex();
115+
}
113116

114117
this.onResize(window.innerWidth);
115118

0 commit comments

Comments
 (0)