diff --git a/lib/client.coffee b/lib/client.coffee index 73bb29c..bfadaed 100644 --- a/lib/client.coffee +++ b/lib/client.coffee @@ -1,4 +1,3 @@ - # Check for cache events on update and automatically refresh. Makes online-mode # work more like the traditional web. @@ -6,9 +5,9 @@ appCache = window.applicationCache exports.autoReload = true -window.addEventListener 'load', (e) -> - appCache.addEventListener 'updateready', (e) -> - if appCache.status == appCache.UPDATEREADY - appCache.swapCache() - window.location.reload() if exports.autoReload - +if appCache + window.addEventListener 'load', (e) -> + appCache.addEventListener 'updateready', (e) -> + if appCache.status == appCache.UPDATEREADY + appCache.swapCache() + window.location.reload() if exports.autoReload