thecheesiumrunner 1.0.6 → 2.0.1

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 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 blob = new Blob([text], { type: 'text/html' });
32
- const blobUrl = URL.createObjectURL(blob);
33
- frame.src = blobUrl;
34
- frame.onload = () => URL.revokeObjectURL(blobUrl);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thecheesiumrunner",
3
- "version": "1.0.6",
3
+ "version": "2.0.1",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
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>