changed browser open page logic
parent
cf4828ae6c
commit
8e236b746a
|
|
@ -22,12 +22,26 @@ const utils = require("./utils");
|
||||||
const environment = process.env["ENVIRONMENT"];
|
const environment = process.env["ENVIRONMENT"];
|
||||||
|
|
||||||
|
|
||||||
const browser = await puppeteer.launch({
|
// launch browser and open page
|
||||||
headless: "new",
|
const chromeProfilePath = path.resolve(
|
||||||
args: ["--no-sandbox", "--disable-setuid-sandbox"]
|
__dirname,
|
||||||
});
|
config[environment]["chrome_profile_path"]
|
||||||
|
);
|
||||||
const page = await browser.newPage();
|
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(
|
await page.goto(
|
||||||
config[environment].psw_url,
|
config[environment].psw_url,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue