offline-plugin-patched
Advanced tools
Comparing version 4.8.3 to 4.9.1-fetchfix
@@ -11,2 +11,4 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
@@ -24,2 +26,6 @@ | ||
var _deepExtend2 = require('deep-extend'); | ||
var _deepExtend3 = _interopRequireDefault(_deepExtend2); | ||
var AppCache = (function () { | ||
@@ -105,5 +111,19 @@ function AppCache(options) { | ||
if (this.FALLBACK) { | ||
FALLBACK = 'FALLBACK:\n' + Object.keys(this.FALLBACK).map(function (path) { | ||
return path + ' ' + _this.FALLBACK[path]; | ||
if (plugin.appShell) { | ||
var scope = undefined; | ||
if (plugin.relativePaths) { | ||
scope = ''; | ||
} else { | ||
scope = plugin.publicPath; | ||
} | ||
FALLBACK = (0, _deepExtend3['default'])(_defineProperty({}, this.pathRewrite(scope), plugin.appShell), this.FALLBACK || {}); | ||
} else if (this.FALLBACK) { | ||
FALLBACK = this.FALLBACK; | ||
} | ||
if (FALLBACK) { | ||
FALLBACK = 'FALLBACK:\n' + Object.keys(FALLBACK).map(function (path) { | ||
return path + ' ' + FALLBACK[path]; | ||
}).join('\n'); | ||
@@ -110,0 +130,0 @@ } |
119
lib/index.js
@@ -21,2 +21,8 @@ 'use strict'; | ||
var _defaultOptions = require('./default-options'); | ||
var _defaultOptions2 = _interopRequireDefault(_defaultOptions); | ||
var _miscUtils = require('./misc/utils'); | ||
var _path2 = require('path'); | ||
@@ -38,4 +44,2 @@ | ||
var _miscUtils = require('./misc/utils'); | ||
var _loaderUtils = require('loader-utils'); | ||
@@ -57,64 +61,3 @@ | ||
var updateStrategies = ['all', 'hash', 'changed']; | ||
var defaultOptions = { | ||
caches: 'all', | ||
publicPath: void 0, | ||
updateStrategy: 'changed', | ||
responseStrategy: 'cache-first', | ||
externals: [], | ||
excludes: ['**/.*', '**/*.map'], | ||
// Hack to have intermediate value, e.g. default one, true and false | ||
relativePaths: ':relativePaths:', | ||
version: null, | ||
autoUpdate: false, | ||
rewrites: function rewrites(asset) { | ||
return asset.replace(/^([\s\S]*?)index.htm(l?)$/, function (match, dir) { | ||
if ((0, _miscUtils.isAbsoluteURL)(match)) { | ||
return match; | ||
} | ||
return dir || './'; | ||
}); | ||
}, | ||
cacheMaps: null, | ||
ServiceWorker: { | ||
output: 'sw.js', | ||
entry: _path3['default'].join(__dirname, '../tpls/empty-entry.js'), | ||
scope: null, | ||
events: false, | ||
prefetchRequest: { | ||
credentials: 'omit', | ||
headers: void 0, | ||
mode: 'cors', | ||
cache: void 0 | ||
}, | ||
minify: null, | ||
navigateFallbackForRedirects: true | ||
}, | ||
AppCache: { | ||
NETWORK: '*', | ||
FALLBACK: null, | ||
directory: 'appcache/', | ||
caches: ['main'], | ||
events: false, | ||
disableInstall: false, | ||
includeCrossOrigin: false | ||
}, | ||
// Needed for testing | ||
__tests: { | ||
swMetadataOnly: false, | ||
ignoreRuntime: false, | ||
noVersionDump: false | ||
}, | ||
// Not yet used | ||
alwaysRevalidate: void 0, | ||
preferOnline: void 0, | ||
ignoreSearch: ['**'] | ||
}; | ||
var OfflinePlugin = (function () { | ||
@@ -126,3 +69,3 @@ function OfflinePlugin(options) { | ||
this.options = (0, _deepExtend2['default'])({}, defaultOptions, options); | ||
this.options = (0, _deepExtend2['default'])({}, _defaultOptions2['default'], options); | ||
this.hash = null; | ||
@@ -177,3 +120,3 @@ this.assets = null; | ||
var rewrites = this.options.rewrites || defaultOptions.rewrites; | ||
var rewrites = this.options.rewrites || _defaultOptions2['default'].rewrites; | ||
@@ -202,4 +145,18 @@ if (typeof rewrites === 'function') { | ||
this.cacheMaps = this.stringifyCacheMaps(this.options.cacheMaps); | ||
if (this.options.appShell && typeof this.options.appShell === 'string') { | ||
this.appShell = this.options.appShell; | ||
} | ||
var cacheMaps = this.options.cacheMaps; | ||
if (this.appShell) { | ||
// Make appShell the latest in the chain so it could be overridden | ||
cacheMaps = (cacheMaps || []).concat({ | ||
match: new Function('return new URL(' + JSON.stringify(this.appShell) + ', location);'), | ||
requestTypes: ['navigate'] | ||
}); | ||
} | ||
this.cacheMaps = this.stringifyCacheMaps(cacheMaps); | ||
this.REST_KEY = ':rest:'; | ||
@@ -247,3 +204,3 @@ this.EXTERNALS_KEY = ':externals:'; | ||
if (this.relativePaths === defaultOptions.relativePaths) { | ||
if (this.relativePaths === _defaultOptions2['default'].relativePaths) { | ||
this.relativePaths = !this.publicPath; | ||
@@ -298,4 +255,11 @@ } | ||
var runtimeTemplatePath = _path3['default'].resolve(__dirname, '../tpls/runtime-template.js'); | ||
var hasRuntime = true; | ||
if (compilation.fileDependencies.indexOf(runtimeTemplatePath) === -1 && !_this2.__tests.ignoreRuntime) { | ||
if (compilation.fileDependencies.indexOf) { | ||
hasRuntime = compilation.fileDependencies.indexOf(runtimeTemplatePath) !== -1; | ||
} else if (compilation.fileDependencies.has) { | ||
hasRuntime = compilation.fileDependencies.has(runtimeTemplatePath); | ||
} | ||
if (!hasRuntime && !_this2.__tests.ignoreRuntime) { | ||
compilation.errors.push(new Error('OfflinePlugin: Plugin\'s runtime wasn\'t added to one of your bundle entries. See this https://goo.gl/YwewYp for details.')); | ||
@@ -338,6 +302,6 @@ callback(); | ||
var caches = this.options.caches || defaultOptions.caches; | ||
var caches = this.options.caches || _defaultOptions2['default'].caches; | ||
if (this.options.safeToUseOptionalCaches !== true && (caches.additional && caches.additional.length || caches.optional && caches.optional.length)) { | ||
compilation.warnings.push(new Error('OfflinePlugin: Cache sections `additional` and `optional` could be used ' + 'only when each asset passed to it has unique name (e.g. hash or version in it) and ' + 'is permanently available for given URL. If you think that it\' your case, ' + 'set `safeToUseOptionalCaches` option to `true`, to remove this warning.')); | ||
compilation.warnings.push(new Error('OfflinePlugin: Cache sections `additional` and `optional` could be used ' + 'only when each asset passed to it has unique name (e.g. hash or version in it) and ' + 'is permanently available for given URL. If you think that it\'s your case, ' + 'set `safeToUseOptionalCaches` option to `true`, to remove this warning.')); | ||
} | ||
@@ -444,3 +408,3 @@ | ||
compilation.warnings.push(new Error('OfflinePlugin: Cache asset [' + cacheKey + '] is not found in the output assets,' + 'if the asset is not processed by webpack, move it to the |externals| option to remove this warning.')); | ||
compilation.warnings.push(new Error('OfflinePlugin: Cache asset [' + cacheKey + '] is not found in the output assets, ' + 'if the asset is not processed by webpack, move it to the |externals| option to remove this warning.')); | ||
} else { | ||
@@ -613,5 +577,6 @@ assets.splice(index, 1); | ||
var to = undefined; | ||
var match = undefined; | ||
if (typeof map.to === 'function') { | ||
to = map.to + ''; | ||
to = (0, _miscUtils.functionToString)(map.to); | ||
} else { | ||
@@ -621,4 +586,10 @@ to = map.to ? JSON.stringify(map.to) : null; | ||
if (typeof map.match === 'function') { | ||
match = (0, _miscUtils.functionToString)(map.match); | ||
} else { | ||
match = map.match + ''; | ||
} | ||
return { | ||
match: map.match + '', | ||
match: match, | ||
to: to, | ||
@@ -773,3 +744,3 @@ requestTypes: map.requestTypes || null | ||
OfflinePlugin.defaultOptions = defaultOptions; | ||
OfflinePlugin.defaultOptions = _defaultOptions2['default']; | ||
module.exports = exports['default']; |
@@ -52,4 +52,6 @@ 'use strict'; | ||
var helpersCode = [', {', 'loaders: ' + loadersCode + ',', 'cacheMaps: ' + cacheMapsCode + ',', '}']; | ||
var navigationPreloadCode = params.navigationPreload; | ||
var helpersCode = [', {', 'loaders: ' + loadersCode + ',', 'cacheMaps: ' + cacheMapsCode + ',', 'navigationPreload: ' + navigationPreloadCode + ',', '}']; | ||
Promise.all([].concat(_toConsumableArray(modules.map(function (mod) { | ||
@@ -56,0 +58,0 @@ return readFile(path.join(__dirname, mod)); |
@@ -10,4 +10,8 @@ 'use strict'; | ||
var cacheMaps = helpers.cacheMaps; | ||
// navigationPreload: true, { map: (URL) => URL, test: (URL) => boolean } | ||
var navigationPreload = helpers.navigationPreload; | ||
// (update)strategy: changed, all | ||
var strategy = params.strategy; | ||
// responseStrategy: cache-first, network-first | ||
var responseStrategy = params.responseStrategy; | ||
@@ -21,7 +25,2 @@ | ||
// Not used yet | ||
// const alwaysRevalidate = params.alwaysRevalidate; | ||
// const ignoreSearch = params.ignoreSearch; | ||
// const preferOnline = params.preferOnline; | ||
var CACHE_PREFIX = params.name; | ||
@@ -31,2 +30,3 @@ var CACHE_TAG = params.version; | ||
var PRELOAD_CACHE_NAME = CACHE_PREFIX + '$preload'; | ||
var STORED_DATA_KEY = '__offline_webpack__data'; | ||
@@ -37,4 +37,7 @@ | ||
var allAssets = [].concat(assets.main, assets.additional, assets.optional); | ||
// Deprecated { | ||
var navigateFallbackURL = params.navigateFallbackURL; | ||
var navigateFallbackForRedirects = params.navigateFallbackForRedirects; | ||
// } | ||
@@ -70,2 +73,6 @@ self.addEventListener('install', function (event) { | ||
if (navigationPreload && self.registration.navigationPreload) { | ||
activation = Promise.all([activation, self.registration.navigationPreload.enable()]); | ||
} | ||
event.waitUntil(activation); | ||
@@ -272,8 +279,30 @@ }); | ||
// If isn't a cached asset and is a navigation request, | ||
// fallback to navigateFallbackURL if available | ||
// perform network request and fallback to navigateFallbackURL if available. | ||
// | ||
// Requesting with fetchWithPreload(). | ||
// Preload is used only if navigationPreload is enabled and | ||
// navigationPreload mapping is not used. | ||
if (navigateFallbackURL && isNavigateRequest(event.request)) { | ||
event.respondWith(handleNavigateFallback(fetch(event.request))); | ||
event.respondWith(handleNavigateFallback(fetchWithPreload(event))); | ||
return; | ||
} | ||
if (navigationPreload === true) { | ||
event.respondWith(fetchWithPreload(event)); | ||
return; | ||
} | ||
// Something else, positive, but not `true` | ||
if (navigationPreload) { | ||
var preloadedResponse = retrivePreloadedResponse(event); | ||
if (preloadedResponse) { | ||
event.respondWith(preloadedResponse); | ||
return; | ||
} | ||
} | ||
// Logic exists here if no cache match, or no preload | ||
return; | ||
} | ||
@@ -287,8 +316,8 @@ | ||
// Logic exists here if no cache match | ||
return; | ||
} | ||
// Logic of caching / fetching is here | ||
// * urlString -- url to match from the CACHE_NAME | ||
// * event.request -- original Request to perform fetch() if necessary | ||
// Cache handling/storing/fetching starts here | ||
var resource = undefined; | ||
@@ -299,3 +328,3 @@ | ||
} | ||
// 'cache-first' | ||
// 'cache-first' otherwise | ||
// (responseStrategy has been validated before) | ||
@@ -326,2 +355,4 @@ else { | ||
function cacheFirstResponse(event, urlString, cacheUrl) { | ||
handleNavigationPreload(event); | ||
return cachesMatch(cacheUrl, CACHE_NAME).then(function (response) { | ||
@@ -371,3 +402,3 @@ if (response) { | ||
function networkFirstResponse(event, urlString, cacheUrl) { | ||
return fetch(event.request).then(function (response) { | ||
return fetchWithPreload(event).then(function (response) { | ||
if (response.ok) { | ||
@@ -395,2 +426,112 @@ if (DEBUG) { | ||
function handleNavigationPreload(event) { | ||
if (navigationPreload && typeof navigationPreload.map === 'function' && | ||
// Use request.mode === 'navigate' instead of isNavigateRequest | ||
// because everything what supports navigationPreload supports | ||
// 'navigate' request.mode | ||
event.preloadResponse && event.request.mode === 'navigate') { | ||
var mapped = navigationPreload.map(new URL(event.request.url), event.request); | ||
if (mapped) { | ||
storePreloadedResponse(mapped, event); | ||
} | ||
} | ||
} | ||
// Temporary in-memory store for faster access | ||
var navigationPreloadStore = new Map(); | ||
function storePreloadedResponse(_url, event) { | ||
var url = new URL(_url, location); | ||
var preloadResponsePromise = event.preloadResponse; | ||
navigationPreloadStore.set(preloadResponsePromise, { | ||
url: url, | ||
response: preloadResponsePromise | ||
}); | ||
var isSamePreload = function isSamePreload() { | ||
return navigationPreloadStore.has(preloadResponsePromise); | ||
}; | ||
var storing = preloadResponsePromise.then(function (res) { | ||
// Return if preload isn't enabled or hasn't happened | ||
if (!res) return; | ||
// If navigationPreloadStore already consumed | ||
// or navigationPreloadStore already contains another preload, | ||
// then do not store anything and return | ||
if (!isSamePreload()) { | ||
return; | ||
} | ||
var clone = res.clone(); | ||
// Storing the preload response for later consume (hasn't yet been consumed) | ||
return caches.open(PRELOAD_CACHE_NAME).then(function (cache) { | ||
if (!isSamePreload()) return; | ||
return cache.put(url, clone).then(function () { | ||
if (!isSamePreload()) { | ||
return caches.open(PRELOAD_CACHE_NAME).then(function (cache) { | ||
return cache['delete'](url); | ||
}); | ||
} | ||
}); | ||
}); | ||
}); | ||
event.waitUntil(storing); | ||
} | ||
function retriveInMemoryPreloadedResponse(url) { | ||
if (!navigationPreloadStore) { | ||
return; | ||
} | ||
var foundResponse = undefined; | ||
var foundKey = undefined; | ||
navigationPreloadStore.forEach(function (store, key) { | ||
if (store.url.href === url.href) { | ||
foundResponse = store.response; | ||
foundKey = key; | ||
} | ||
}); | ||
if (foundResponse) { | ||
navigationPreloadStore['delete'](foundKey); | ||
return foundResponse; | ||
} | ||
} | ||
function retrivePreloadedResponse(event) { | ||
var url = new URL(event.request.url); | ||
if (self.registration.navigationPreload && navigationPreload && navigationPreload.test && navigationPreload.test(url, event.request)) {} else { | ||
return; | ||
} | ||
var fromMemory = retriveInMemoryPreloadedResponse(url); | ||
var request = event.request; | ||
if (fromMemory) { | ||
event.waitUntil(caches.open(PRELOAD_CACHE_NAME).then(function (cache) { | ||
return cache['delete'](request); | ||
})); | ||
return fromMemory; | ||
} | ||
return cachesMatch(request, PRELOAD_CACHE_NAME).then(function (response) { | ||
if (response) { | ||
event.waitUntil(caches.open(PRELOAD_CACHE_NAME).then(function (cache) { | ||
return cache['delete'](request); | ||
})); | ||
} | ||
return response || fetch(event.request); | ||
}); | ||
} | ||
function handleNavigateFallback(fetching) { | ||
@@ -467,3 +608,7 @@ return fetching['catch'](function () {}).then(function (response) { | ||
var extracted = []; | ||
var addAll = []; | ||
return Promise.all(requests.map(function (request) { | ||
if (bustValue) { | ||
@@ -473,18 +618,15 @@ request = applyCacheBust(request, bustValue); | ||
return fetch(request, requestInit).then(fixRedirectedResponse); | ||
})).then(function (responses) { | ||
if (responses.some(function (response) { | ||
return !response.ok; | ||
})) { | ||
return Promise.reject(new Error('Wrong response status')); | ||
} | ||
return fetch(request, requestInit).then(fixRedirectedResponse).then(function (response) { | ||
var extracted = []; | ||
var addAll = responses.map(function (response, i) { | ||
if (!response.ok) { | ||
return Promise.reject(new Error('Wrong response status')); | ||
} | ||
if (allowLoaders) { | ||
extracted.push(extractAssetsWithLoaders(requests[i], response)); | ||
extracted.push(extractAssetsWithLoaders(request, response)); | ||
} | ||
return cache.put(requests[i], response); | ||
addAll.push(cache.put(request, response)); | ||
}); | ||
})).then(function () { | ||
@@ -538,3 +680,3 @@ if (extracted.length) { | ||
if (request.mode === 'navigate') { | ||
if (isNavigateRequest(request)) { | ||
requestType = 'navigate'; | ||
@@ -568,2 +710,12 @@ } else if (url.origin === location.origin) { | ||
} | ||
function fetchWithPreload(event) { | ||
if (!event.preloadResponse || navigationPreload !== true) { | ||
return fetch(event.request); | ||
} | ||
return event.preloadResponse.then(function (response) { | ||
return response || fetch(event.request); | ||
}); | ||
} | ||
} | ||
@@ -575,3 +727,3 @@ | ||
}).then(function (response) { | ||
if (isNotRedirectedResponse()) { | ||
if (isNotRedirectedResponse(response)) { | ||
return response; | ||
@@ -598,29 +750,2 @@ } | ||
function getClientsURLs() { | ||
if (!self.clients) { | ||
return Promise.resolve([]); | ||
} | ||
return self.clients.matchAll({ | ||
includeUncontrolled: true | ||
}).then(function (clients) { | ||
if (!clients.length) return []; | ||
var result = []; | ||
clients.forEach(function (client) { | ||
var url = new URL(client.url); | ||
url.search = ''; | ||
url.hash = ''; | ||
var urlString = url.toString(); | ||
if (!result.length || result.indexOf(urlString) === -1) { | ||
result.push(urlString); | ||
} | ||
}); | ||
return result; | ||
}); | ||
} | ||
function isNavigateRequest(request) { | ||
@@ -627,0 +752,0 @@ return request.mode === 'navigate' || request.headers.get('Upgrade-Insecure-Requests') || (request.headers.get('Accept') || '').indexOf('text/html') !== -1; |
@@ -10,2 +10,4 @@ 'use strict'; | ||
exports.isAbsoluteURL = isAbsoluteURL; | ||
exports.functionToString = functionToString; | ||
exports.arrowFnToNormalFn = arrowFnToNormalFn; | ||
@@ -79,2 +81,35 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function functionToString(fn) { | ||
if (typeof fn !== 'function') { | ||
return '(void 0)'; | ||
} | ||
var string = fn + ''; | ||
return arrowFnToNormalFn(string); | ||
} | ||
// Migrate to separate npm-package with full tests | ||
function arrowFnToNormalFn(string) { | ||
var match = string.match(/^([\s\S]+?)=\>(\s*{)?([\s\S]*?)(}\s*)?$/); | ||
if (!match) { | ||
return string; | ||
} | ||
var args = match[1]; | ||
var body = match[3]; | ||
var needsReturn = !(match[2] && match[4]); | ||
args = args.replace(/^(\s*\(\s*)([\s\S]*?)(\s*\)\s*)$/, '$2'); | ||
if (needsReturn) { | ||
body = 'return ' + body; | ||
} | ||
return 'function(' + args + ') {' + body + '}'; | ||
} | ||
exports.isAbsolutePath = isAbsolutePath; |
@@ -54,2 +54,3 @@ 'use strict'; | ||
this.prefetchRequest = this.validatePrefetch(options.prefetchRequest); | ||
this.navigationPreload = options.navigationPreload; | ||
@@ -81,3 +82,4 @@ var cacheNameQualifier = ''; | ||
loaders: Object.keys(plugin.loaders), | ||
cacheMaps: plugin.cacheMaps | ||
cacheMaps: plugin.cacheMaps, | ||
navigationPreload: this.stringifyNavigationPreload(this.navigationPreload, plugin) | ||
}); | ||
@@ -260,2 +262,23 @@ | ||
} | ||
}, { | ||
key: 'stringifyNavigationPreload', | ||
value: function stringifyNavigationPreload(navigationPreload, plugin) { | ||
var result = undefined; | ||
if (typeof navigationPreload === 'object') { | ||
result = navigationPreload = '{\n map: ' + (0, _miscUtils.functionToString)(navigationPreload.map) + ',\n test: ' + (0, _miscUtils.functionToString)(navigationPreload.test) + '\n }'; | ||
} else { | ||
if (typeof navigationPreload !== 'boolean') { | ||
if (plugin.responseStrategy === 'network-first') { | ||
navigationPreload = true; | ||
} else { | ||
navigationPreload = false; | ||
} | ||
} | ||
result = JSON.stringify(navigationPreload); | ||
} | ||
return result; | ||
} | ||
}]); | ||
@@ -262,0 +285,0 @@ |
{ | ||
"name": "offline-plugin-patched", | ||
"version": "4.8.3", | ||
"version": "4.9.1-fetchfix", | ||
"description": "offline-plugin for webpack, patched for AppCache fixes", | ||
@@ -13,3 +13,7 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"test": "node tests/legacy/run && eslint -c configs/eslint.tests.json 'tests/**/**.js'", | ||
"test": "node tests/legacy/run && eslint -c configs/eslint.tests.json 'tests/legacy/**.js'", | ||
"test:browser": "node tests/run-browser-tests.js", | ||
"test:ci_fixtures": "npm run test", | ||
"test:ci_browser": "npm install puppeteer@^0.12.0 && npm run test:browser", | ||
"test:ci_all": "npm run test:ci_fixtures && npm run test:ci_browser", | ||
"build": "./node_modules/.bin/babel src/ -d lib/", | ||
@@ -24,5 +28,6 @@ "watch": "npm run build -- --watch", | ||
"release:latest:major": "npm version major && npm run tag && npm run publish:latest", | ||
"release:next:patch": "npm version patch && npm run tag && npm run publish:next", | ||
"release:next:minor": "npm version minor && npm run tag && npm run publish:next", | ||
"release:next:major": "npm version major && npm run tag && npm run publish:next" | ||
"release:next:patch": "npm --no-git-tag-version version prepatch && npm run publish:next", | ||
"release:next:minor": "npm --no-git-tag-version version preminor && npm run publish:next", | ||
"release:next:major": "npm --no-git-tag-version version premajor && npm run publish:next", | ||
"release:next:update": "npm --no-git-tag-version version prerelease && npm run publish:next" | ||
}, | ||
@@ -36,3 +41,3 @@ "collective": { | ||
"type": "git", | ||
"url": "https://github.com/jampy81/offline-plugin.git" | ||
"url": "https://github.com/NekR/offline-plugin.git" | ||
}, | ||
@@ -42,2 +47,3 @@ "author": "Arthur Stolyar <nekr.fabula@gmail.com>", | ||
"dependencies": { | ||
"babel": "^5.8.38", | ||
"deep-extend": "^0.4.0", | ||
@@ -72,2 +78,3 @@ "ejs": "^2.3.4", | ||
"cli-highlight": "^1.1.4", | ||
"copy-webpack-plugin": "^4.2.0", | ||
"del": "^2.2.2", | ||
@@ -77,2 +84,5 @@ "diff": "^3.0.1", | ||
"eslint": "^3.14.1", | ||
"express": "^4.16.2", | ||
"glob": "^7.1.2", | ||
"mocha": "^4.0.1", | ||
"on-build-webpack": "^0.1.0", | ||
@@ -79,0 +89,0 @@ "webpack": "1.14.0" |
@@ -1,2 +0,2 @@ | ||
<div align="center"> | ||
<div align="center"> | ||
<a href="https://offline-plugin.now.sh/"><img src="https://rawgit.com/NekR/offline-plugin/master/logo/logo.svg" width="120" alt="offline-plugin logo"></a> | ||
@@ -10,3 +10,2 @@ | ||
<a href="https://www.npmjs.com/package/offline-plugin"><img src="https://img.shields.io/npm/dm/offline-plugin.svg?maxAge=3600" alt="npm"></a> | ||
<a href="https://gitter.im/NekR/offline-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/NekR/offline-plugin.svg" alt="Join the chat at https://gitter.im/NekR/offline-plugin"></a> | ||
</div> | ||
@@ -18,3 +17,3 @@ <br> | ||
<div align="center"> | ||
<strong>Demo:<br><a href="https://offline-plugin.now.sh/"> Progressive Web App built with <code>offline-plugin</code></a></strong><br> | ||
<strong>Demo:<br><a href="https://offline-plugin.now.sh/"> Progressive Web App built with <code>offline-plugin</code></a></strong><br> | ||
<div>(<a href="https://github.com/NekR/offline-plugin-pwa"><i>source code</i></a>)</div> | ||
@@ -141,2 +140,3 @@ </div> | ||
* [Online Board](https://onlineboard.sonnywebdesign.com/) ([source](https://github.com/andreasonny83/online-board)) | ||
* [CodePan](https://codepan.net) ([source](https://github.com/egoist/codepan)) | ||
@@ -188,3 +188,3 @@ | ||
See [CONTRIBUTING](CONTIBUTING.md) | ||
See [CONTRIBUTING](CONTRIBUTING.md) | ||
@@ -191,0 +191,0 @@ ## License |
@@ -147,2 +147,3 @@ var appCacheIframe; | ||
var match = (e.data + '').match(/__offline-plugin_AppCacheEvent:(\w+)/); | ||
if (!match) return; | ||
var event = match[1]; | ||
@@ -149,0 +150,0 @@ |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
108344
21
2133
6
12
1
7
+ Addedbabel@^5.8.38
+ Addedacorn@5.7.4(transitive)
+ Addedalign-text@0.1.4(transitive)
+ Addedalter@0.2.0(transitive)
+ Addedamdefine@1.0.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedanymatch@1.3.2(transitive)
+ Addedarr-diff@2.0.04.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.2.10.3.2(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedast-traverse@0.1.1(transitive)
+ Addedast-types@0.8.120.9.6(transitive)
+ Addedasync-each@1.0.6(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbabel@5.8.38(transitive)
+ Addedbabel-core@5.8.38(transitive)
+ Addedbabel-plugin-constant-folding@1.0.1(transitive)
+ Addedbabel-plugin-dead-code-elimination@1.0.2(transitive)
+ Addedbabel-plugin-eval@1.0.1(transitive)
+ Addedbabel-plugin-inline-environment-variables@1.0.1(transitive)
+ Addedbabel-plugin-jscript@1.0.4(transitive)
+ Addedbabel-plugin-member-expression-literals@1.0.1(transitive)
+ Addedbabel-plugin-property-literals@1.0.1(transitive)
+ Addedbabel-plugin-proto-to-assign@1.0.4(transitive)
+ Addedbabel-plugin-react-constant-elements@1.0.3(transitive)
+ Addedbabel-plugin-react-display-name@1.0.3(transitive)
+ Addedbabel-plugin-remove-console@1.0.1(transitive)
+ Addedbabel-plugin-remove-debugger@1.0.1(transitive)
+ Addedbabel-plugin-runtime@1.0.7(transitive)
+ Addedbabel-plugin-undeclared-variables-check@1.0.2(transitive)
+ Addedbabel-plugin-undefined-to-void@1.1.6(transitive)
+ Addedbabylon@5.8.38(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbinary-extensions@1.13.1(transitive)
+ Addedbindings@1.5.0(transitive)
+ Addedbluebird@2.11.0(transitive)
+ Addedbraces@1.8.52.3.2(transitive)
+ Addedbreakable@1.0.0(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcamelcase@1.2.1(transitive)
+ Addedcenter-align@0.1.3(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedchokidar@1.7.0(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcliui@2.1.0(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addedcommoner@0.10.8(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcore-js@1.2.7(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddefined@1.0.1(transitive)
+ Addeddefs@1.1.1(transitive)
+ Addeddetect-indent@3.0.1(transitive)
+ Addeddetective@4.7.1(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesprima@2.7.33.1.3(transitive)
+ Addedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedexpand-brackets@0.1.52.1.4(transitive)
+ Addedexpand-range@1.8.2(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@0.3.22.0.4(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)
+ Addedfilename-regex@2.0.1(transitive)
+ Addedfill-range@2.2.44.0.0(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfor-own@0.1.5(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfs-readdir-recursive@0.1.2(transitive)
+ Addedfsevents@1.2.13(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob@5.0.15(transitive)
+ Addedglob-base@0.3.0(transitive)
+ Addedglob-parent@2.0.0(transitive)
+ Addedglobals@6.4.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhome-or-tmp@1.0.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedinvert-kv@1.0.0(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-binary-path@1.0.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-dotfile@1.0.3(transitive)
+ Addedis-equal-shallow@0.1.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@1.0.0(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-glob@2.0.1(transitive)
+ Addedis-integer@1.0.7(transitive)
+ Addedis-number@2.1.03.0.04.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-posix-bracket@0.1.1(transitive)
+ Addedis-primitive@2.0.0(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedjs-tokens@1.0.1(transitive)
+ Addedjsesc@0.5.0(transitive)
+ Addedjson5@0.4.0(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedlazy-cache@1.0.4(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedleven@1.0.2(transitive)
+ Addedlodash@3.10.1(transitive)
+ Addedlongest@1.0.1(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmath-random@1.0.4(transitive)
+ Addedmicromatch@2.3.113.1.10(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.0.0(transitive)
+ Addednan@2.22.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addednormalize-path@2.1.1(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.omit@2.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-locale@1.4.0(transitive)
+ Addedos-tmpdir@1.0.2(transitive)
+ Addedoutput-file-sync@1.1.2(transitive)
+ Addedparse-glob@3.0.4(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-exists@1.0.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedpreserve@0.2.0(transitive)
+ Addedprivate@0.1.8(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedq@1.5.1(transitive)
+ Addedrandomatic@3.1.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedreaddirp@2.2.1(transitive)
+ Addedrecast@0.10.330.11.23(transitive)
+ Addedregenerate@1.4.2(transitive)
+ Addedregenerator@0.8.40(transitive)
+ Addedregex-cache@0.4.4(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedregexpu@1.3.0(transitive)
+ Addedregjsgen@0.2.0(transitive)
+ Addedregjsparser@0.1.5(transitive)
+ Addedremove-trailing-separator@1.1.0(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedrepeating@1.1.3(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedright-align@0.1.3(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsimple-fmt@0.1.0(transitive)
+ Addedsimple-is@0.2.0(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-map@0.1.320.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-support@0.2.10(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstable@0.1.8(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstringmap@0.2.2(transitive)
+ Addedstringset@0.2.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedto-fast-properties@1.0.3(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedtrim-right@1.0.1(transitive)
+ Addedtry-resolve@1.0.1(transitive)
+ Addedtryor@0.1.2(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
+ Addeduser-home@1.1.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwindow-size@0.1.4(transitive)
+ Addedwordwrap@0.0.2(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@3.2.2(transitive)
+ Addedyargs@3.27.0(transitive)