changed browser open page logic

pull/2/head
syed.bilal 2026-01-23 11:24:42 +05:00
parent cf4828ae6c
commit 8e236b746a
1 changed files with 20 additions and 6 deletions

View File

@ -22,12 +22,26 @@ const utils = require("./utils");
const environment = process.env["ENVIRONMENT"];
const browser = await puppeteer.launch({
headless: "new",
args: ["--no-sandbox", "--disable-setuid-sandbox"]
});
// launch browser and open page
const chromeProfilePath = path.resolve(
__dirname,
config[environment]["chrome_profile_path"]
);
const browser = await puppeteer.launch(
utils.getBrowserConfig(chromeProfilePath, environment)
);
const page = await browser.newPage();
await page.setViewport({
width: 1600,
height: 900,
});
const page = await browser.newPage();
// Inject CSS to show the cursor
await page.evaluate(() => {
const style = document.createElement("style");
style.innerHTML = "* { cursor: auto !important; }";
document.head.appendChild(style);
});
await page.goto(
config[environment].psw_url,