changed browser open page logic
parent
cf4828ae6c
commit
8e236b746a
|
|
@ -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"]
|
||||
});
|
||||
|
||||
const page = await browser.newPage();
|
||||
// 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,
|
||||
});
|
||||
|
||||
// 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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue