blob: 54bad94bc9fc298f99e35793656650e2d2711e81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<!DOCTYPE html>
<html>
<head>
<title>Bug 1663192 - Accessing localStorage in a file urls</title>
</head>
<script>
window.addEventListener("DOMContentLoaded", () => {
let result = document.getElementById("result");
try {
window.localStorage.setItem("foo", "bar");
result.textContent = "PASS";
} catch (e) {
result.textContent = "FAIL";
}
}, { once: true });
</script>
<body>
<a id="result"></a>
</body>
</html>
|