Skip to content

Commit

Permalink
added test for privacy Cache API block
Browse files Browse the repository at this point in the history
  • Loading branch information
optimalisatie committed Nov 2, 2018
1 parent 03f743d commit d62837c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions dist/cache-api-keyval.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/cache-api-keyval.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
}
}

var nosupport_error = 'Browser does not support Cache API';

if (!_root.CacheApiDBFallback) {
_root.CacheApiDBFallback = function() {
var that = this;
that.supported = 0;
['get', 'set', 'del', 'prune'].forEach(function(method) {
that[method] = function() {
return Promise.reject(error);
return Promise.reject(nosupport_error);
}
});
}
}

// detect Cache API support
if (!(caches instanceof CacheStorage)) {
print_error('Browser does not support Cache API');
print_error(nosupport_error);
_root.CacheApiDB = _root.CacheApiDBFallback;
} else {

Expand Down

0 comments on commit d62837c

Please sign in to comment.