Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appcache-nanny

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appcache-nanny - npm Package Compare versions

Comparing version 0.0.6 to 1.0.0

.npmignore

27

appcache-nanny.js

@@ -123,2 +123,6 @@ // appCacheNanny

clearInterval(intervalPointer);
// check with offline interval
checkInterval = hasNetworkError ? appCacheNanny.get('offlineCheckInterval') : appCacheNanny.get('checkInterval');
intervalPointer = setInterval(appCacheNanny.update, checkInterval);

@@ -221,2 +225,13 @@ isCheckingForUpdatesFlag = true;

// https://github.com/gr2m/appcache-nanny/issues/7
if (applicationCache.status !== applicationCache.UNCACHED) {
subscribeToEvents();
setupPending = false;
setupDone = true;
setupCallbacks.forEach(function(callback) {
callback();
});
return;
}
// load the appcache-loader.html using an iframe

@@ -331,6 +346,3 @@ iframe = document.createElement('iframe');

// reset check interval
checkInterval = appCacheNanny.get('checkInterval');
appCacheNanny.start();
trigger('online');

@@ -354,4 +366,2 @@ }

// check with offline interval
checkInterval = appCacheNanny.get('offlineCheckInterval');
appCacheNanny.start();

@@ -381,9 +391,2 @@

appCacheNanny.stop();
// Tell the user that an update is waiting on next page reload
if (! hasUpdateFlag) {
hasUpdateFlag = true;
// don't use trigger here, otherwise the event wouldn't get triggered
appCacheNanny.trigger('updateready');
}
}

@@ -390,0 +393,0 @@

{
"name": "appcache-nanny",
"version": "0.0.6",
"version": "1.0.0",
"authors": [

@@ -5,0 +5,0 @@ "Gregor Martynus <gregor@martynus.net>"

{
"name": "appcache-nanny",
"version": "0.0.6",
"version": "1.0.0",
"description": "Teaches the applicationCache douchebag some manners!",
"main": "appcache-nanny.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node ./bin/test-browser.js",
"start": "node ./bin/dev-server.js"
},

@@ -23,3 +24,15 @@ "repository": {

},
"homepage": "https://github.com/gr2m/appcache-nanny"
"homepage": "https://github.com/gr2m/appcache-nanny",
"devDependencies": {
"chai": "^1.10.0",
"chai-as-promised": "^4.1.1",
"colors": "^1.0.3",
"hapi": "^8.1.0",
"mocha": "^2.1.0",
"moment": "^2.9.0",
"sauce-connect-launcher": "^0.9.3",
"selenium-standalone": "^2.44.0-4",
"wd": "^0.3.11"
},
"dependencies": {}
}

@@ -6,2 +6,4 @@ The appCache Nanny

[![Build Status](https://travis-ci.org/gr2m/appcache-nanny.svg)](https://travis-ci.org/gr2m/appcache-nanny)
As we all know, the [Application Cache is a Douchbag](http://alistapart.com/article/application-cache-is-a-douchebag).

@@ -90,25 +92,16 @@ It's time to teach it some manners – The appCache Nanny for Rescue!

```js
cd server
node index.js
# optionally pass a custom port number:
# node index.js 1234
npm start
```
It will start a local server at http://localhost:8888 (per default).
It will start a local server at http://localhost:8888.
Each time the `index.html` gets loaded, the background changes. Try by reloading
the page. Then hit the `Check for update` button, you will see a few log meesages
below. If you reload the page again, the color will change one more time (it's the
index.html that just got downloaded in the background). But if you reload again,
it won't change any more. You can now stop the server, you will still be able to
restart the page.
This is a static server with a few hidden features:
In order to simulate a change in the application, hit the `Bump revision` button
(make sure to start the server again beforehand). If you check for an update again,
you will see that a new version got downloaded, it now says `has update? yes` on top.
- `GET /bump-version` increases the app version, so an update gets triggered
on next check
- `GET /remove-manifest` makes `GET /manifest.appcache` return 404, so it
becomes obsolete on next check
- `GET /recreate-manifest` undoes the previous step.
Note that every path will show the index.html file, try http://localhost:8888/some/path
for example.
Gotchas

@@ -115,0 +108,0 @@ -------

Sorry, the diff of this file is not supported yet

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