You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
145 lines
4.5 KiB
145 lines
4.5 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<title>React DevTools</title>
|
|
<style>
|
|
html,
|
|
body {
|
|
width: 100vw;
|
|
height: 100vh;
|
|
padding: 0;
|
|
margin: 0;
|
|
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
|
|
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
|
|
}
|
|
|
|
a {
|
|
color: inherit;
|
|
text-decoration: none;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
#hint {
|
|
margin: 1em;
|
|
font-size: 16px;
|
|
}
|
|
|
|
#root {
|
|
width: 100%;
|
|
height: 100%;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<noscript>
|
|
You need to enable JavaScript to run this app.
|
|
</noscript>
|
|
<div id="hint">Conntecting to ReactDevToolsProxy...</div>
|
|
<div id="root"></div>
|
|
<!--
|
|
JSPM Generator Import Map
|
|
Edit URL: https://generator.jspm.io/#U2NgYGBkDM0rySzJSU1hKEpNTC7RTUktK8nPzynWTc4vSnUw0TMy1zPSLy5JzEtJzMnPSwUAiUm0+zQA
|
|
-->
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"react-devtools-core/standalone": "https://ga.jspm.io/npm:react-devtools-core@4.27.2/standalone.js"
|
|
},
|
|
"scopes": {
|
|
"https://ga.jspm.io/": {
|
|
"buffer": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/buffer.js",
|
|
"child_process": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/child_process.js",
|
|
"crypto": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/crypto.js",
|
|
"events": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/events.js",
|
|
"fs": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/fs.js",
|
|
"http": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/http.js",
|
|
"https": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/https.js",
|
|
"net": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/net.js",
|
|
"path": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/path.js",
|
|
"process": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/process-production.js",
|
|
"stream": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/stream.js",
|
|
"tls": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/tls.js",
|
|
"url": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/url.js",
|
|
"util": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/util.js",
|
|
"vm": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/vm.js",
|
|
"zlib": "https://ga.jspm.io/npm:@jspm/core@2.0.1/nodelibs/browser/zlib.js"
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<!-- ES Module Shims: Import maps polyfill for modules browsers without import maps support (all except Chrome 89+) -->
|
|
<script async src="https://ga.jspm.io/npm:es-module-shims@1.5.1/dist/es-module-shims.js"
|
|
crossorigin="anonymous"></script>
|
|
|
|
<script type="module">
|
|
import { default as DevToolsUIWrapper } from "react-devtools-core/standalone";
|
|
const DevTools = DevToolsUIWrapper.default;
|
|
|
|
/**
|
|
* Private command to support DevTools frontend reload
|
|
*/
|
|
const RELOAD_COMMAND = 'Expo::RELOAD';
|
|
|
|
function connectAsync(url) {
|
|
return new Promise((resolve, reject) => {
|
|
const ws = new WebSocket(url);
|
|
|
|
ws.addEventListener("open", () => {
|
|
resolve(ws);
|
|
});
|
|
|
|
ws.addEventListener("close", (e) => {
|
|
reject(e);
|
|
});
|
|
|
|
ws.addEventListener("error", (e) => {
|
|
reject(e);
|
|
});
|
|
});
|
|
}
|
|
|
|
async function delayAsync(timeMs) {
|
|
return new Promise((resolve) => setTimeout(resolve, timeMs));
|
|
}
|
|
|
|
async function connectAsyncWithRetries(url) {
|
|
while (true) {
|
|
try {
|
|
const ws = await connectAsync(url);
|
|
document.getElementById("hint").style.display = "none";
|
|
return ws;
|
|
} catch {
|
|
document.getElementById("hint").style.display = "block";
|
|
await delayAsync(5000);
|
|
}
|
|
}
|
|
}
|
|
|
|
async function main() {
|
|
const ws = await connectAsyncWithRetries("ws://localhost:8097");
|
|
|
|
ws.addEventListener("close", () => {
|
|
document.getElementById("hint").style.display = "block";
|
|
main();
|
|
});
|
|
DevTools.setContentDOMNode(document.getElementById("root"));
|
|
ws.send(RELOAD_COMMAND);
|
|
DevTools.connectToSocket(ws);
|
|
}
|
|
|
|
main();
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|