Urara-Blog/node_modules/.pnpm-store/v3/files/d8/2f95a231cdd268eb301c925efb2906d78ae42d9ee30ad99c688a7597a0a075bc1bf25a6fd935476b4eb1ee37b498ad03affaead1c83a6a68dc3db2a1788f52
2022-08-14 01:14:53 +08:00

32 lines
988 B
Text

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import { logger } from 'workbox-core/_private/logger.js';
import { isSupported } from './isSupported.js';
import './_version.js';
/**
* If the browser supports Navigation Preload, then this will disable it.
*
* @memberof workbox-navigation-preload
*/
function disable() {
if (isSupported()) {
self.addEventListener('activate', (event) => {
event.waitUntil(self.registration.navigationPreload.disable().then(() => {
if (process.env.NODE_ENV !== 'production') {
logger.log(`Navigation preload is disabled.`);
}
}));
});
}
else {
if (process.env.NODE_ENV !== 'production') {
logger.log(`Navigation preload is not supported in this browser.`);
}
}
}
export { disable };