StorageManager.persisted()
Contexto seguro: Esta función está disponible solo en contextos seguros (HTTPS), en algunos o todos los navegadores que lo soportan.
Experimental: Esta es una tecnología experimental
Comprueba la Tabla de compabilidad de navegadores cuidadosamente antes de usarla en producción.
La propiedad persisted
de la interfaz StorageManager
devuelve una Promise
que se resuelve como true
si box mode es persistente para el alamacenamiento de su sitio.
Sintaxis
navigator.storage.persisted().then(function(persistent) { ... })
Parámetros
Ninguno.
Devuelve
Ejemplo
js
if (navigator.storage && navigator.storage.persist)
navigator.storage.persisted().then(function (persistent) {
if (persistent)
console.log("Storage will not be cleared except by explicit user action");
else
console.log("Storage may be cleared by the UA under storage pressure.");
});
Especificaciones
Specification |
---|
Storage # dom-storagemanager-persisted |
Compatibilidad con navegadores
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
persisted |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.