New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sw-appcache-behavior

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sw-appcache-behavior - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

24

client-runtime.js

@@ -799,4 +799,26 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

// TODO: Handle manifest fetch failure errors.
// TODO: Consider cache-busting if the manifest response > 24 hours old.
fetch(manifestRequest).then(function(manifestResponse) {
var dateHeaderValue = manifestResponse.headers.get('date');
if (dateHeaderValue) {
var manifestDate = new Date(dateHeaderValue).valueOf();
// Calculate the age of the manifest in milliseconds.
var manifestAgeInMillis = Date.now() - manifestDate;
// If the age is greater than 24 hours, then we need to refetch without
// hitting the cache.
if (manifestAgeInMillis > (24 * 60 * 60 * 1000)) {
var noCacheRequest = new Request(manifestUrl, {
credentials: 'include',
// See https://fetch.spec.whatwg.org/#requestcache
cache: 'reload',
headers: {
'X-Use-Fetch': true
}
});
return fetch(noCacheRequest).then(function(noCacheResponse) {
return noCacheResponse.text();
});
}
}
return manifestResponse.text();

@@ -803,0 +825,0 @@ }).then(function(text) {

2

package.json
{
"name": "sw-appcache-behavior",
"version": "0.0.3",
"version": "0.0.4",
"description": "A service worker implementation of the behavior defined in a page's App Cache manifest.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -18,3 +18,3 @@ # sw-appcache-behavior

[projects/sw-appcache-behavior/src/appcache-behavior-import.js:501-514](https://github.com/GoogleChrome/sw-helpers/blob/f2d1b9af36cfc912af7f40cef607f0ed10cb827e/projects/sw-appcache-behavior/src/appcache-behavior-import.js#L501-L514 "Source code on GitHub")
[projects/sw-appcache-behavior/src/appcache-behavior-import.js:501-514](https://github.com/GoogleChrome/sw-helpers/blob/0c15c2fde8a3f835d03d47af2075e5171af11f39/projects/sw-appcache-behavior/src/appcache-behavior-import.js#L501-L514 "Source code on GitHub")

@@ -79,2 +79,2 @@ `goog.legacyAppCacheBehavior` is the main entry point to the library

Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).&lt;[Response](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5)>**
Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[Response](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5)>**
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc