thecheesiumrunner 1.0.6 → 2.0.0
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.svg +6 -4
- package/package.json +1 -1
- package/index.html +0 -25
package/index.svg
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<xhtml:body>
|
|
13
13
|
<xhtml:iframe id="fm" src="about:blank"></xhtml:iframe>
|
|
14
14
|
<xhtml:script>
|
|
15
|
+
//<![CDATA[
|
|
15
16
|
(function() {
|
|
16
17
|
function size() {
|
|
17
18
|
var w = window.innerWidth, h = window.innerHeight;
|
|
@@ -28,15 +29,16 @@
|
|
|
28
29
|
const res = await fetch(url);
|
|
29
30
|
const text = await res.text();
|
|
30
31
|
const frame = document.getElementById('fm');
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const fdoc = frame.contentDocument || frame.contentWindow.document;
|
|
33
|
+
fdoc.open();
|
|
34
|
+
fdoc.write(text);
|
|
35
|
+
fdoc.close();
|
|
35
36
|
} catch(e) {
|
|
36
37
|
console.error('Loader error:', e);
|
|
37
38
|
}
|
|
38
39
|
})();
|
|
39
40
|
})();
|
|
41
|
+
//]]>
|
|
40
42
|
</xhtml:script>
|
|
41
43
|
</xhtml:body>
|
|
42
44
|
</xhtml:html>
|
package/package.json
CHANGED
package/index.html
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
launch();
|
|
3
|
-
|
|
4
|
-
function launch() {
|
|
5
|
-
try {
|
|
6
|
-
fetch("https://unpkg.com/thecheesiumrunner@latest/dist/index.html?t="+Date.now())
|
|
7
|
-
.then(response => response.text())
|
|
8
|
-
.then(html => {
|
|
9
|
-
document.documentElement.innerHTML = html;
|
|
10
|
-
|
|
11
|
-
document.documentElement.querySelectorAll('script').forEach(oldScript => {
|
|
12
|
-
const newScript = document.createElement('script');
|
|
13
|
-
if (oldScript.src) {
|
|
14
|
-
newScript.src = oldScript.src;
|
|
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
|
-
</script>
|