Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk2 min

How to Clear Permission Overrides in Puppeteer

Use and await clearPermissionOverrides() on the BrowserContext that received the override. The reset clears all permission overrides in that context.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Call and await clearPermissionOverrides() on the same Puppeteer BrowserContext where you set the override. It clears all permission overrides for that context—not just one origin—and returns a promise.

Clear overrides on the context that received them

clearPermissionOverrides() is a BrowserContext method, not a Page method. For an override made in Puppeteer’s default context:

As an Amazon Associate I earn from qualifying purchases.

const context = browser.defaultBrowserContext();

await context.overridePermissions('https://example.com', ['clipboard-read']);

// Run the work that needs the permission override.

await context.clearPermissionOverrides();

Await the call before relying on permissions being reset. The method returns Promise<void>. See the Puppeteer API reference.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand the scope of the reset

The method clears all permission overrides in the selected browser context. It is not a per-origin undo operation: the underlying Chrome DevTools Protocol resets permission management for all origins in the selected context. For the default context, the protocol uses an omitted context ID to select that context.

Therefore, if several origins have overrides in the same context, calling this method resets them all. If you need separate permission state for independent automation tasks, use separate browser contexts rather than expecting this method to target a single origin.

Use a separate context when isolation matters

A separate context can isolate an automation task. Puppeteer’s browser-management guide documents that browser contexts isolate cookies and local storage, and that closing a context closes its pages. Clearing overrides is still done on the context itself; creating a new one is not required just to clear permissions.

Rank #2
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option
const context = await browser.createBrowserContext();
try {
  const page = await context.newPage();
  await context.overridePermissions('https://example.com', ['geolocation']);

  // Run isolated work.

  await context.clearPermissionOverrides();
} finally {
  await context.close();
}

This pattern combines documented context and permission operations. If the isolated task is finished, closing its context handles its lifecycle; if you intend to reuse it, clear the overrides and keep the context open. See the Puppeteer browser-management guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common mistakes and fixes

  • Calling the method on a page: It belongs to BrowserContext. Keep a reference to the context used for overridePermissions() and call the reset there.
  • Not awaiting the reset: Because the method returns a promise, use await before subsequent work that depends on the reset.
  • Expecting only one origin to be reset: The operation clears every permission override in that context. Use distinct contexts when tasks need isolated permission state.
  • Using a different context: A reset applies to the context on which it is called. If you overrode permissions in a non-default context, clear them on that same context.
  • Expecting the reset to close or recreate a context: Clearing permissions and closing a context are separate operations. Call context.close() when you want to end that context’s lifecycle.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your goal is a clean website screenshot rather than managing a Puppeteer browser, ScreenshotNeo can return an image or PDF with one API request. Its API handles cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots, and the free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000.

For example, this cURL request saves a WebP screenshot:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Sign up for 1,000 free screenshots a month, with no card required.

Rank #4
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.