source: frontend/node_modules/workbox-navigation-preload/disable.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 988 bytes
Line 
1/*
2 Copyright 2018 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8import { logger } from 'workbox-core/_private/logger.js';
9import { isSupported } from './isSupported.js';
10import './_version.js';
11/**
12 * If the browser supports Navigation Preload, then this will disable it.
13 *
14 * @memberof workbox-navigation-preload
15 */
16function disable() {
17 if (isSupported()) {
18 self.addEventListener('activate', (event) => {
19 event.waitUntil(self.registration.navigationPreload.disable().then(() => {
20 if (process.env.NODE_ENV !== 'production') {
21 logger.log(`Navigation preload is disabled.`);
22 }
23 }));
24 });
25 }
26 else {
27 if (process.env.NODE_ENV !== 'production') {
28 logger.log(`Navigation preload is not supported in this browser.`);
29 }
30 }
31}
32export { disable };
Note: See TracBrowser for help on using the repository browser.