Skip to content

Commit d62837c

Browse files
committed
added test for privacy Cache API block
1 parent 03f743d commit d62837c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dist/cache-api-keyval.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cache-api-keyval.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,23 @@
3636
}
3737
}
3838

39+
var nosupport_error = 'Browser does not support Cache API';
40+
3941
if (!_root.CacheApiDBFallback) {
4042
_root.CacheApiDBFallback = function() {
4143
var that = this;
4244
that.supported = 0;
4345
['get', 'set', 'del', 'prune'].forEach(function(method) {
4446
that[method] = function() {
45-
return Promise.reject(error);
47+
return Promise.reject(nosupport_error);
4648
}
4749
});
4850
}
4951
}
5052

5153
// detect Cache API support
5254
if (!(caches instanceof CacheStorage)) {
53-
print_error('Browser does not support Cache API');
55+
print_error(nosupport_error);
5456
_root.CacheApiDB = _root.CacheApiDBFallback;
5557
} else {
5658

0 commit comments

Comments
 (0)