thecheesiumrunner 1.0.1 → 1.0.3
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/index.html +12 -24
- package/index.svg +5 -7
- package/package.json +1 -1
package/index.html
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
2
|
+
launch();
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} else {
|
|
16
|
-
newScript.textContent = oldScript.textContent;
|
|
17
|
-
}
|
|
18
|
-
document.body.appendChild(newScript);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error('error:', error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
</script>
|
|
4
|
+
function launch() {
|
|
5
|
+
fetch("https://unpkg.com/thecheesiumrunner@latest/dist/index.html?t=" + Date.now())
|
|
6
|
+
.then(response => response.text())
|
|
7
|
+
.then(html => {
|
|
8
|
+
const blob = new Blob([html], { type: 'text/html' });
|
|
9
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
10
|
+
location.replace(blobUrl);
|
|
11
|
+
})
|
|
12
|
+
.catch(error => console.error('error:', error));
|
|
13
|
+
}
|
|
14
|
+
</script>
|
package/index.svg
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
<xhtml:body>
|
|
13
13
|
<xhtml:iframe id="fm" src="about:blank"></xhtml:iframe>
|
|
14
14
|
<xhtml:script>
|
|
15
|
-
//<![CDATA[
|
|
16
15
|
(function() {
|
|
17
16
|
function size() {
|
|
18
17
|
var w = window.innerWidth, h = window.innerHeight;
|
|
@@ -25,20 +24,19 @@
|
|
|
25
24
|
window.addEventListener('resize', size);
|
|
26
25
|
(async () => {
|
|
27
26
|
try {
|
|
28
|
-
const url = 'https://unpkg.com/thecheesiumrunner@latest/index.html?t=' + Date.now();
|
|
27
|
+
const url = 'https://unpkg.com/thecheesiumrunner@latest/dist/index.html?t=' + Date.now();
|
|
29
28
|
const res = await fetch(url);
|
|
30
29
|
const text = await res.text();
|
|
31
30
|
const frame = document.getElementById('fm');
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const blob = new Blob([text], { type: 'text/html' });
|
|
32
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
33
|
+
frame.src = blobUrl;
|
|
34
|
+
frame.onload = () => URL.revokeObjectURL(blobUrl);
|
|
36
35
|
} catch(e) {
|
|
37
36
|
console.error('Loader error:', e);
|
|
38
37
|
}
|
|
39
38
|
})();
|
|
40
39
|
})();
|
|
41
|
-
//]]>
|
|
42
40
|
</xhtml:script>
|
|
43
41
|
</xhtml:body>
|
|
44
42
|
</xhtml:html>
|