diff --git a/src/rageshake/submit-rageshake.js b/src/rageshake/submit-rageshake.js index 53e9f24788..5a7039a913 100644 --- a/src/rageshake/submit-rageshake.js +++ b/src/rageshake/submit-rageshake.js @@ -119,6 +119,12 @@ export default async function sendBugReport(bugReportEndpoint, opts) { body.append("storageManager_persisted", await navigator.storage.persisted()); } catch (e) {} } + // Safari + if (document.hasStorageAccess) { + try { + body.append("storageManager_persisted", await document.hasStorageAccess()); + } catch (e) {} + } if (navigator.storage && navigator.storage.estimate) { try { const estimate = await navigator.storage.estimate(); diff --git a/src/utils/StorageManager.js b/src/utils/StorageManager.js index 4ed118da8a..175772903d 100644 --- a/src/utils/StorageManager.js +++ b/src/utils/StorageManager.js @@ -48,6 +48,11 @@ export function tryPersistStorage() { navigator.storage.persist().then(persistent => { console.log("StorageManager: Persistent?", persistent); }); + } else if (document.requestStorageAccess) { //Safari + document.requestStorageAccess().then( + () => console.log("StorageManager: Persistent?", true), + () => console.log("StorageManager: Persistent?", false), + ); } else { console.log("StorageManager: Persistence unsupported"); }