I’m attempting to clear the browsing history in a non-headless Chromium browser using Node.js with Puppeteer. I’ve implemented the following snippets, but none have yielded results.
await page.goto('chrome://settings/clearBrowserData');
await page.keyboard.press('Enter');
For my second attempt:
await page.keyboard.press('Control');
await page.keyboard.press('Shift');
await page.keyboard.press('Delete');
await page.keyboard.press('Enter');
I also tried using .evaluateHandle()
and .click()
methods, but those didn’t work either. If anyone has a solution for clearing history in Puppeteer, I would appreciate your guidance.