diff --git a/.gitignore b/.gitignore index 128f0f9..82be075 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /node_modules/ /static/ +/.log/ +/yarn-error.log diff --git a/Docker/utils.sh b/Docker/utils.sh index ba26708..30add45 100644 --- a/Docker/utils.sh +++ b/Docker/utils.sh @@ -83,6 +83,7 @@ prepare_firefox(){ keycombo Shift_L F5 #profiler grab "after shift-c F5" keycombo Control_L Shift_L e + sleep 5 # it needs some time } load_website(){ diff --git a/index.js b/index.js index 22ccf7f..b1fa55d 100644 --- a/index.js +++ b/index.js @@ -32,23 +32,12 @@ function attach(docker_id, output_stream) { output_stream.push(d); }); task.on("close", () => { - const check = spawn("docker", ["ps", "--filter", `id=${docker_id}`]); - let output = ""; - check.on("data", (data) => { - output += data; - }); - check.on("close", () => { - console.log("CHECK", output); - clearInterval(interval); - }); - check.on("error", (error) => { - console.error("error", error); - clearInterval(interval); - }); - check.on("exit", (error) => { - console.error("exit", error); - clearInterval(interval); - }); + output_stream.push(""); + output_stream.push(/* HTML */ ``); + clearInterval(interval); + output_stream.push(null); }); } @@ -64,7 +53,7 @@ router.get("/", async (ctx) => { `
` ); ctx.body.push(/* HTML */ ``); const params = qs.parse(ctx.querystring); s.push(`Got request to screenshot ${params.url}
`);