Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/auth/CreateAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ class CreateAuth {
});
sessionResources.x11vnc = x11vnc;

await this._waitForPort(vncPort, 5000, signal);
await this._waitForPort(vncPort, 30000, signal);
this.logger.info("[VNC] VNC server is ready.");
checkAborted();

Expand Down Expand Up @@ -331,7 +331,7 @@ class CreateAuth {
});
sessionResources.websockify = websockify;

await this._waitForPort(websockifyPort, 5000, signal);
await this._waitForPort(websockifyPort, 30000, signal);
this.logger.info("[VNC] Websockify is ready.");
checkAborted();

Expand Down Expand Up @@ -373,7 +373,7 @@ class CreateAuth {
padding: 0 !important;
width: 100vw !important;
height: 100vh !important;
overflow: hidden !important;
overflow: auto !important;
}
\`;
document.addEventListener("DOMContentLoaded", () => {
Expand Down
13 changes: 4 additions & 9 deletions src/core/BrowserManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const fs = require("fs");
const path = require("path");
const { firefox, devices } = require("playwright");
const { firefox } = require("playwright");
const os = require("os");

const { parseProxyFromEnv } = require("../utils/ProxyUtils");
Expand Down Expand Up @@ -1309,14 +1309,11 @@ class BrowserManager {
// This browser instance is temporary and specific to the VNC session.
// It does NOT affect the main `this.browser` used for the API proxy.
const vncBrowser = await firefox.launch({
args: this.launchArgs,
env: {
...process.env,
...extraArgs.env,
},
executablePath: this.browserExecutablePath,
firefoxUserPrefs: this.firefoxUserPrefs,
// Must be false for VNC to be visible.
headless: false,
...(proxyConfig ? { proxy: proxyConfig } : {}),
});
Expand All @@ -1329,12 +1326,10 @@ class BrowserManager {

let contextOptions = {};
if (extraArgs.isMobile) {
this.logger.info("[VNC] Mobile device detected. Applying mobile user-agent, viewport, and touch events.");
const mobileDevice = devices["Pixel 5"];
this.logger.info("[VNC] Mobile client detected; applying Firefox Android context for VNC login.");
contextOptions = {
hasTouch: mobileDevice.hasTouch,
userAgent: mobileDevice.userAgent,
viewport: { height: 915, width: 412 }, // Set a specific portrait viewport
hasTouch: true,
userAgent: "Mozilla/5.0 (Android 10; Mobile; rv:128.0) Gecko/128.0 Firefox/128.0",
};
}

Expand Down
Loading