diff --git a/src/auth/CreateAuth.js b/src/auth/CreateAuth.js index f91d63a7..97c832a4 100644 --- a/src/auth/CreateAuth.js +++ b/src/auth/CreateAuth.js @@ -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(); @@ -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(); @@ -373,7 +373,7 @@ class CreateAuth { padding: 0 !important; width: 100vw !important; height: 100vh !important; - overflow: hidden !important; + overflow: auto !important; } \`; document.addEventListener("DOMContentLoaded", () => { diff --git a/src/core/BrowserManager.js b/src/core/BrowserManager.js index 6793e30e..b976c686 100644 --- a/src/core/BrowserManager.js +++ b/src/core/BrowserManager.js @@ -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"); @@ -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 } : {}), }); @@ -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", }; }