Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Puppeteer old Headless deprecation warning:

const bot = require("puppeteer");
const fs = require("fs");
const botConfiguration ={
headless:false, 
executablePath:"C:/Program Files/Google/Chrome/Application/chrome.exe",
userDataDir: "C:/Users/bot/AppData/Local/Google/Chrome/User Data/",
args: ['--profile-directory=Profile 28']
};
async function runBot() {
const chromeBrowser = await bot.launch(botConfiguration)
const chromeBrowserPage = await chromeBrowser.newPage()
await chromeBrowserPage.goto("https://www.google.com/")
};
runBot();

Puppeteer old Headless deprecation warning:

In the near future headless: true will default to the new Headless mode for Chrome instead of the old Headless implementation. For more information, please see https://developer.chrome.com/articles/new-headless/. Consider opting in early by passing headless: "new" to puppeteer.launch() If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.

I do not want to see this error in my terminal ............

Puppeteer old Headless deprecation warning:

like image 914
jaytheblogger Avatar asked Nov 06 '25 23:11

jaytheblogger


1 Answers

It is just a warning for users. The only way to make it disappear is putting headless:'new' option. If you dont care your headless option, just change yours with the offered one.

const browser = await puppeteer.launch({
  headless: 'new',
  // `headless: true` (default) enables old Headless;
  // `headless: 'new'` enables new Headless;
  // `headless: false` enables “headful” mode.
});
like image 195
Volkan Albayrak Avatar answered Nov 11 '25 13:11

Volkan Albayrak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!