Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Fix socket connection

Ondra Urban15ca608a4bbf
diff --git a/src/live_view/index.html b/src/live_view/index.html
index c0a3a6bff..1fc269a20 100644
--- a/src/live_view/index.html
+++ b/src/live_view/index.html
@@ -158,13 +158,18 @@
$('#resumeButton').click((event) => {
event.preventDefault();
- socket = connect();
+ if (!liveViewSocket) {
+ liveViewSocket = connect();
+ }
$('#resumeButton').hide();
$('#pauseButton').show();
});
$('#pauseButton').click((event) => {
event.preventDefault();
- if (socket) socket.close();
+ if (liveViewSocket) {
+ liveViewSocket.close();
+ liveViewSocket = null;
+ }
$('#resumeButton').show();
$('#pauseButton').hide();
});