From 9d2b9a1f9001d7184479fe61e1521d0324084749 Mon Sep 17 00:00:00 2001 From: NAME Date: Sat, 23 May 2026 16:24:11 +0000 Subject: [PATCH] Update --- src/x-poster/x.pw.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/x-poster/x.pw.service.ts b/src/x-poster/x.pw.service.ts index 64a0075..aad4d67 100644 --- a/src/x-poster/x.pw.service.ts +++ b/src/x-poster/x.pw.service.ts @@ -17,7 +17,8 @@ export class XPwService implements OnModuleDestroy { async runWithProfile(targetUrl?: string): Promise { // 1. Định nghĩa đường dẫn lưu trữ Profile (nằm trong thư mục dự án) const profilePath = path.resolve(__dirname, `../../x_profile_data/${process.env.X_USERNAME}`); - + const width = _toNumber(process.env.BROWSER_WP_WIDTH || 1479); + const height = _toNumber(process.env.BROWSER_WP_HEIGHT || 795); // 2. Cấu hình các tham số ẩn danh (Antidetect) const antidetectArgs = [ '--disable-blink-features=AutomationControlled', @@ -27,6 +28,7 @@ export class XPwService implements OnModuleDestroy { '--no-default-browser-check', // '--disable-setuid-sandbox' `--user-agent=${process.env.BROWSER_USER_AGENT}`, + `--window-size=${width},${height}` ]; @@ -43,8 +45,8 @@ export class XPwService implements OnModuleDestroy { // ========================================== chromiumSandbox: true, viewport: { - width: _toNumber(process.env.BROWSER_WP_WIDTH || 1479), - height: _toNumber(process.env.BROWSER_WP_HEIGHT || 795), + width: width, + height: height, } }); }