Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<head>
<script>
function handleStorageEvent(e) {
if (window.sessionStorage === e.storageArea)
e.storageAreaString = "sessionStorage";
else if (window.localStorage === e.storageArea)
e.storageAreaString = "localStorage";
window.parent.storageEventList.push(e);
}
</script>
</head>
<body onstorage="handleStorageEvent(event);">
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE HTML>
<html>
<head>
<script>
function handleStorageEvent(e) {
window.parent.storageEventList.push(e);
}
</script>
</head>
<body onstorage="handleStorageEvent(event);">
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE HTML>
<html>
<head></head>
<body>
<script>
function handleStorageEvent(e) {
window.parent.storageEventList.push(e);
}
document.body.setAttribute("onstorage", "handleStorageEvent(event);");
</script>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('localStorage' in window) && window.localStorage !== null){
try {
localStorage.setItem("name", "user1");
localStorage.setItem("name", "user2");
} catch (e) {
parent.fail("setItem method is failed.");
}
localStorage.clear();
} else {
parent.fail("localStorage is not supported.");
}
</script>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('localStorage' in window) && window.localStorage !== null){
try {
localStorage.setItem("name", "user1");
} catch (e) {
parent.fail("setItem method is failed.");
}
localStorage.clear();
} else {
parent.fail("localStorage is not supported.");
}
</script>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('localStorage' in window) && window.localStorage !== null){
try {
localStorage.setItem("name", "user1");
} catch (e) {
parent.fail("setItem method is failed.");
}
} else {
parent.fail("localStorage is not supported.");
}
</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
parent.step(function() {
localStorage.setItem("name", "user1");
localStorage.removeItem('name');
});
</script>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!doctype html>
<meta charset="utf-8">
<script>
function getOrCreateID(key) {
if (!localStorage.getItem(key)) {
const newID = +new Date() + "-" + Math.random();
localStorage.setItem(key, newID);
}
return localStorage.getItem(key);
}
window.addEventListener("load", () => {
// if we have an opener, we know that we are loaded inside a cross-site
// iframe (because we opened it ourselves).
if (parent.opener) {
const payload = {
message: "cross-site window iframe loaded",
userID: getOrCreateID("userID"),
}
parent.opener.postMessage(payload, parent.opener.origin);
}
});
window.addEventListener("message", (e) => {
if (e.data.command == "create ID") {
getOrCreateID(e.data.key);
// storage is set, call back to window.
const payload = {
message: "ID created",
userID: localStorage.getItem("userID"),
}
e.source.postMessage(payload, e.source.origin);
}
if (e.data.command == "clearStorage") {
localStorage.clear();
}
});
</script>

View File

@ -0,0 +1,37 @@
<!doctype html>
<meta charset="utf-8">
<script src="./partitioning-utils.js"></script>
<script>
window.addEventListener("load", () => {
localStorage.clear();
const userID = getOrCreateID("userID4");
const payload = {
message: "window loaded",
userID,
}
let win = window.opener ? window.opener : window.parent;
win.postMessage(payload, "*");
});
window.addEventListener("message", e => {
let win = window.opener ? parent.window.opener : window.parent;
if (e.data.command == "open about:blank window") {
window.blankWindow = window.open("about:blank");
const payload = {
message: "about:blank frame ID",
userID: window.blankWindow?.localStorage["userID4"],
}
let win = window.opener ? parent.window.opener : window.parent;
win.postMessage(payload, "*");
}
if (e.data.command == "close about:blank window") {
window.blankWindow.close();
win.postMessage({message: "about:blank window closed"}, "*");
}
});
</script>

View File

@ -0,0 +1,20 @@
function getOrCreateID(key) {
if (!localStorage.getItem(key)) {
const newID = +new Date() + "-" + Math.random();
localStorage.setItem(key, newID);
}
return localStorage.getItem(key);
}
function addIframePromise(url) {
return new Promise(resolve => {
const iframe = document.createElement("iframe");
iframe.style.display = "none";
iframe.src = url;
iframe.addEventListener("load", (e) => {
resolve(iframe);
}, {once: true});
document.body.appendChild(iframe);
});
}

View File

@ -0,0 +1,44 @@
<!doctype html>
<meta charset="utf-8">
<script>
function getOrCreateID(key) {
if (!sessionStorage.getItem(key)) {
const newID = new Date() + "-" + Math.random();
sessionStorage.setItem(key, newID);
}
return sessionStorage.getItem(key);
}
window.addEventListener("load", () => {
// In this testing set-up, only cross-site iframes will have an opener.
if (parent.opener) {
const payload = {
message: "cross-site window iframe loaded",
userID: getOrCreateID("userID"),
}
// Once the cross-site iframe has loaded, we send a message back to
// the main window with the ID from sessionStorage.
parent.opener.postMessage(payload, parent.opener.origin);
}
});
window.addEventListener("message", (e) => {
if (e.data.command == "create ID") {
// e.data.key is equivalent to "userID"
getOrCreateID(e.data.key);
const payload = {
message: "ID created",
userID: sessionStorage.getItem("userID"),
}
// Return the ID from sessionStorage to the main window.
e.source.postMessage(payload, e.source.origin);
}
// Additional functionality for clean-up at the end of the test.
if (e.data.command == "clearStorage") {
sessionStorage.clear();
}
});
</script>

View File

@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('sessionStorage' in window) && window.sessionStorage !== null){
try {
sessionStorage.setItem("name", "user1");
sessionStorage.setItem("name", "user2");
} catch (e) {
parent.fail("setItem method is failed.");
}
sessionStorage.clear();
} else {
parent.fail("sessionStorage is not supported.");
}
</script>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('sessionStorage' in window) && window.sessionStorage !== null){
try {
sessionStorage.setItem('name', 'user1');
} catch (e) {
parent.fail('setItem method is failed.');
}
sessionStorage.clear();
} else {
parent.fail('sessionStorage is not supported.');
}
</script>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
if (('sessionStorage' in window) && window.sessionStorage !== null){
try {
sessionStorage.setItem('name', 'user1');
} catch (e) {
parent.fail('setItem method is failed.');
}
} else {
parent.fail('sessionStorage is not supported.');
}
</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<body>
<script>
parent.step(function() {
sessionStorage.setItem("name", "user1");
sessionStorage.removeItem('name');
});
</script>
</body>
</html>

View File

@ -0,0 +1,36 @@
<!DOCTYPE HTML>
<html>
<head>
<title>WebStorage Test: localStorage - second page</title>
</head>
<body>
<script>
var storage = window.localStorage;
var assertions = [];
assertions.push({
actual: storage.getItem("FOO"),
expected: "BAR",
message: "storage.getItem('FOO')"
});
storage.setItem("FOO", "BAR-NEWWINDOW");
assertions.push({
actual: storage.getItem("FOO"),
expected: "BAR-NEWWINDOW",
message: "value for FOO after changing"
});
assertions.push({
actual: window.opener.localStorage.getItem("FOO"),
expected: "BAR-NEWWINDOW",
message: "value for FOO in my opening window"
});
window.opener.postMessage(assertions, '*');
</script>
</body>
</html>

View File

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<head>
<title>WebStorage Test: sessionStorage - second page</title>
</head>
<body>
<script>
var storage = window.sessionStorage;
var assertions = [];
assertions.push({
actual: storage.getItem("FOO"),
expected: null,
message: "storage.getItem('FOO')"
});
storage.setItem("FOO", "BAR-NEWWINDOW");
assertions.push({
actual: storage.getItem("FOO"),
expected: "BAR-NEWWINDOW",
message: "value for FOO after changing"
});
let channel = new BroadcastChannel('storage_session_window_noopener');
channel.postMessage(assertions, '*');
window.close();
</script>
</body>
</html>

View File

@ -0,0 +1,41 @@
<!DOCTYPE HTML>
<html>
<head>
<title>WebStorage Test: sessionStorage - second page</title>
</head>
<body>
<script>
var storage = window.sessionStorage;
var assertions = [];
assertions.push({
actual: storage.getItem("FOO"),
expected: "BAR",
message: "storage.getItem('FOO')"
});
storage.setItem("FOO", "BAR-NEWWINDOW");
assertions.push({
actual: storage.getItem("FOO"),
expected: "BAR-NEWWINDOW",
message: "value for FOO after changing"
});
assertions.push({
actual: window.opener.sessionStorage.getItem("FOO"),
expected: "BAR",
message: "value for FOO in my opening window"
});
assertions.push({
actual: storage.getItem("BAZ"),
expected: null,
message: "value for BAZ set after window.open(), is not set in new window"
});
window.opener.postMessage(assertions, '*');
</script>
</body>
</html>