vfsjs-test 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/logo.svg +45 -0
- package/main.js +7 -6
- package/package.json +1 -1
package/logo.svg
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<foreignObject width="100%" height="100%">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" style="width:100%;height:100%">
|
|
4
|
+
<head>
|
|
5
|
+
<style>
|
|
6
|
+
body,html,iframe{width:100%;height:100%}body,html{margin:0;padding:0;background:#000;overflow:hidden}iframe{border:0}
|
|
7
|
+
</style>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<script>
|
|
11
|
+
//
|
|
12
|
+
<![CDATA[
|
|
13
|
+
(function() {
|
|
14
|
+
const src = "https://cdn.jsdelivr.net/npm/vfsjs-test@1.0.4/";
|
|
15
|
+
|
|
16
|
+
// In SVG, document.body is null. We must find the XHTML body manually:
|
|
17
|
+
const targetBody = document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "body")[0];
|
|
18
|
+
|
|
19
|
+
fetch(src + "index.html")
|
|
20
|
+
.then(res => res.text())
|
|
21
|
+
.then(html => {
|
|
22
|
+
const frame = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe");
|
|
23
|
+
targetBody.appendChild(frame);
|
|
24
|
+
|
|
25
|
+
const patchedHtml = html.replace("<head>", `<head><base href="${src}" />`);
|
|
26
|
+
|
|
27
|
+
const doc = frame.contentWindow.document;
|
|
28
|
+
doc.open();
|
|
29
|
+
doc.write(patchedHtml);
|
|
30
|
+
doc.close();
|
|
31
|
+
})
|
|
32
|
+
.catch(err => {
|
|
33
|
+
console.error("Loader Error:", err);
|
|
34
|
+
if (targetBody) {
|
|
35
|
+
targetBody.style.color = "white";
|
|
36
|
+
targetBody.innerHTML = "Failed to load content: " + err.message;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
})();
|
|
40
|
+
// ]]>
|
|
41
|
+
</script>
|
|
42
|
+
</body>
|
|
43
|
+
</html>
|
|
44
|
+
</foreignObject>
|
|
45
|
+
</svg>
|
package/main.js
CHANGED
|
@@ -44,12 +44,13 @@ async function bootEngine() {
|
|
|
44
44
|
display.innerHTML += "<br>> Link secured. Executing transaction assertions...";
|
|
45
45
|
|
|
46
46
|
// Run Verification Loop
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
// Inside main.js verification block:
|
|
48
|
+
vfs.add('live-theme.css', `body { background: #070a13 !important; color: #22d3ee !important; }`);
|
|
49
|
+
|
|
50
|
+
vfs.add('index.js', `
|
|
51
|
+
console.log("VFS Execute: Active out of virtual memory pipeline!");
|
|
52
|
+
document.getElementById('status').innerHTML += "<br>> Virtual index.js routing validated.";
|
|
53
|
+
`, 'text/javascript');
|
|
53
54
|
|
|
54
55
|
// Verify Delete Works
|
|
55
56
|
vfs.add('trash.js', 'console.log("drop")');
|