workbox-navigation-preload
Advanced tools
Comparing version 3.5.0 to 3.6.1
@@ -6,3 +6,3 @@ this.workbox = this.workbox || {}; | ||
try { | ||
self.workbox.v['workbox:navigation-preload:3.5.0'] = 1; | ||
self.workbox.v['workbox:navigation-preload:3.6.1'] = 1; | ||
} catch (e) {} // eslint-disable-line | ||
@@ -53,2 +53,39 @@ | ||
/** | ||
* If the browser supports Navigation Preload, then this will disable it. | ||
* | ||
* @memberof workbox.navigationPreload | ||
*/ | ||
function disable() { | ||
if (isSupported()) { | ||
self.addEventListener('activate', event => { | ||
event.waitUntil(self.registration.navigationPreload.disable().then(() => { | ||
{ | ||
logger_mjs.logger.log(`Navigation preload is disabled.`); | ||
} | ||
})); | ||
}); | ||
} else { | ||
{ | ||
logger_mjs.logger.log(`Navigation preload is not supported in this browser.`); | ||
} | ||
} | ||
} | ||
/* | ||
Copyright 2017 Google Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
/** | ||
* If the browser supports Navigation Preload, then this will enable it. | ||
@@ -116,2 +153,3 @@ * | ||
exports.disable = disable; | ||
exports.enable = enable; | ||
@@ -118,0 +156,0 @@ exports.isSupported = isSupported; |
@@ -1,3 +0,3 @@ | ||
this.workbox=this.workbox||{},this.workbox.navigationPreload=function(t){"use strict";try{self.workbox.v["workbox:navigation-preload:3.5.0"]=1}catch(t){}function e(){return Boolean(self.registration&&self.registration.navigationPreload)}return t.enable=function(t){e()&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{t&&self.registration.navigationPreload.setHeaderValue(t)}))})},t.isSupported=e,t}({}); | ||
this.workbox=this.workbox||{},this.workbox.navigationPreload=function(t){"use strict";try{self.workbox.v["workbox:navigation-preload:3.6.1"]=1}catch(t){}function e(){return Boolean(self.registration&&self.registration.navigationPreload)}return t.disable=function(){e()&&self.addEventListener("activate",t=>{t.waitUntil(self.registration.navigationPreload.disable().then(()=>{}))})},t.enable=function(t){e()&&self.addEventListener("activate",e=>{e.waitUntil(self.registration.navigationPreload.enable().then(()=>{t&&self.registration.navigationPreload.setHeaderValue(t)}))})},t.isSupported=e,t}({}); | ||
//# sourceMappingURL=workbox-navigation-preload.prod.js.map |
{ | ||
"name": "workbox-navigation-preload", | ||
"version": "3.5.0", | ||
"version": "3.6.1", | ||
"license": "Apache-2.0", | ||
@@ -29,4 +29,4 @@ "author": "Google's Web DevRel Team", | ||
"dependencies": { | ||
"workbox-core": "^3.5.0" | ||
"workbox-core": "^3.6.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19775
13
294
5
1
Updatedworkbox-core@^3.6.1