CARVIEW |
Select Language
HTTP/2 301
location: https://raw.githubusercontent.com/nbubna/store/master/src/store.overflow.js
accept-ranges: bytes
age: 0
date: Mon, 21 Jul 2025 21:46:26 GMT
via: 1.1 varnish
x-served-by: cache-hyd1100030-HYD
x-cache: MISS
x-cache-hits: 0
x-timer: S1753134386.072908,VS0,VE253
vary: Accept-Encoding
x-fastly-request-id: c0b753866499b76f0ff9e6beb2f0da878e3f3c35
content-length: 0
HTTP/2 200
cache-control: max-age=300
content-security-policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
content-type: text/plain; charset=utf-8
etag: W/"e90b83091344347b4cd3aabf03d96864501ec4c9544d4879c7ec12932f55bcea"
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: deny
x-xss-protection: 1; mode=block
x-github-request-id: BFEA:7C50C:D212:3309D:687EB532
content-encoding: gzip
accept-ranges: bytes
date: Mon, 21 Jul 2025 21:46:26 GMT
via: 1.1 varnish
x-served-by: cache-hyd1100027-HYD
x-cache: MISS
x-cache-hits: 0
x-timer: S1753134386.402111,VS0,VE256
vary: Authorization,Accept-Encoding
access-control-allow-origin: *
cross-origin-resource-policy: cross-origin
x-fastly-request-id: f6e15bd98ba8fe572f22ae85e444ae92d05b59e4
expires: Mon, 21 Jul 2025 21:51:26 GMT
source-age: 0
content-length: 1127
/**
* Copyright (c) 2013 ESHA Research
* Dual licensed under the MIT and GPL licenses:
* https://www.opensource.org/licenses/mit-license.php
* https://www.gnu.org/licenses/gpl.html
*
* When quota is reached on a storage area, this shifts incoming values to
* fake storage, so they last only as long as the page does. This is useful
* because it is more burdensome for localStorage to recover from quota errors
* than incomplete caches. In other words, it is wiser to rely on store.js
* never complaining than never missing data. You should already be checking
* the integrity of cached data on every page load.
*
* Status: BETA
*/
;(function(store, _) {
var _set = _.set,
_get = _.get,
_remove = _.remove,
_key = _.key,
_length = _.length,
_clear = _.clear;
_.overflow = function(area, create) {
var name = area === _.areas.local ? '+local+' :
area === _.areas.session ? '+session+' : false;
if (name) {
var overflow = _.areas[name];
if (create && !overflow) {
overflow = store.area(name)._area;// area() copies to _.areas
} else if (create === false) {
delete _.areas[name];
delete store[name];
}
return overflow;
}
};
_.set = function(area, key, string) {
try {
_set.apply(this, arguments);
} catch (e) {
if (e.name === 'QUOTA_EXCEEDED_ERR' ||
e.name === 'NS_ERROR_DOM_QUOTA_REACHED' ||
e.toString().indexOf("QUOTA_EXCEEDED_ERR") !== -1 ||
e.toString().indexOf("QuotaExceededError") !== -1) {
// the e.toString is needed for IE9 / IE10, cos name is empty there
return _.set(_.overflow(area, true), key, string);
}
throw e;
}
};
_.get = function(area, key) {
var overflow = _.overflow(area);
return (overflow && _get.call(this, overflow, key)) ||
_get.apply(this, arguments);
};
_.remove = function(area, key) {
var overflow = _.overflow(area);
if (overflow){ _remove.call(this, overflow, key); }
_remove.apply(this, arguments);
};
_.key = function(area, i) {
var overflow = _.overflow(area);
if (overflow) {
var l = _length.call(this, area);
if (i >= l) {
i = i - l;// make i overflow-relative
for (var j=0, m=_length.call(this, overflow); j