Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
Β·
131324f
1
Parent(s):
01903e8
π show error message
Browse files
server.ts
CHANGED
|
@@ -29,6 +29,7 @@ app.use(async (ctx) => {
|
|
| 29 |
<p>Page can store cookies: <span id="page-can-store-cookies"></span></p>
|
| 30 |
<button id="check-storage-access" type="button">Re-check storage access</button>
|
| 31 |
<button id="request-storage-access" style="display: none;" type="button">Request storage access</button>
|
|
|
|
| 32 |
</body>
|
| 33 |
<script>
|
| 34 |
const storageAccess = document.getElementById("storage-access-api");
|
|
@@ -55,7 +56,10 @@ app.use(async (ctx) => {
|
|
| 55 |
document.requestStorageAccess().then(() => {
|
| 56 |
pageCanStoreCookies.innerText = "Yes";
|
| 57 |
requestStorageAccess.style.display = "none";
|
| 58 |
-
})
|
|
|
|
|
|
|
|
|
|
| 59 |
});
|
| 60 |
checkStorageAccessBtn.addEventListener("click", checkStorageAccess);
|
| 61 |
</script>
|
|
|
|
| 29 |
<p>Page can store cookies: <span id="page-can-store-cookies"></span></p>
|
| 30 |
<button id="check-storage-access" type="button">Re-check storage access</button>
|
| 31 |
<button id="request-storage-access" style="display: none;" type="button">Request storage access</button>
|
| 32 |
+
<p style="color: red" id="error-p"></p>
|
| 33 |
</body>
|
| 34 |
<script>
|
| 35 |
const storageAccess = document.getElementById("storage-access-api");
|
|
|
|
| 56 |
document.requestStorageAccess().then(() => {
|
| 57 |
pageCanStoreCookies.innerText = "Yes";
|
| 58 |
requestStorageAccess.style.display = "none";
|
| 59 |
+
}).catch((e) => {
|
| 60 |
+
console.error(e);
|
| 61 |
+
document.getElementById("error-p").innerText = e.message;
|
| 62 |
+
})
|
| 63 |
});
|
| 64 |
checkStorageAccessBtn.addEventListener("click", checkStorageAccess);
|
| 65 |
</script>
|