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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Short answer: if the translation popup belongs to Firefox Nightly rather than the webpage, Playwright’s page locators and JavaScript-dialog handlers are not documented ways to click or dismiss it. First check the Firefox and Playwright versions you are testing; then, if translation prompts are not needed, manage the offer in Firefox’s translation settings. Playwright can launch Firefox with user preferences, but the exact preference for this Nightly popup is not established here, so verify any preference against your specific build before relying on it.

First identify which popup you are trying to close

A webpage dialog and a Firefox translation panel may look similarly intrusive, but they are controlled by different software. A webpage-owned element is part of the page content that Playwright can inspect and locate. A browser-owned panel is part of Firefox’s interface, outside the page’s DOM.

The reported Nightly problem was the latter: the reporter could close the panel manually, but page.getByText('Cancel').click() did not find a page element, and pressing Escape did not dismiss it. The accepted Stack Overflow answer said the issue was fixed in the then-current Playwright canary on November 3, 2023. That is a dated report, not a guarantee about every current Playwright and Firefox Nightly combination. See the original report and answer.

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

This distinction matters when debugging: repeatedly changing a locator or adding a page-level keyboard press cannot make Firefox-owned chrome become a webpage element. Playwright’s Locator documentation describes locators as the central mechanism for page auto-waiting and retrying. Its Dialog API concerns JavaScript dialogs such as alert, confirm, prompt, and beforeunload, not Firefox’s translation panel.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

Check the Playwright and Firefox versions before changing your test

Because the reported fix was specific to the canary available on November 3, 2023, establish what your test actually runs before adopting that answer as a fix. Record the installed Playwright version and whether the Firefox executable is the browser build managed by Playwright or a separately installed Nightly build. A result for one combination does not establish behavior for another.

  1. Check the installed package: in a Node project, run npx playwright --version and npm ls playwright playwright-core. The second command helps reveal which package versions are present in that project.
  2. Check the browser under test: make sure your test configuration launches the browser you intend to test. Do not assume that a system Firefox Nightly and Playwright’s installed Firefox build are interchangeable.
  3. Reproduce the failure in that exact combination: distinguish a popup that appears in Firefox’s interface from a consent or translation element rendered inside the website. If the latter is in the page, a locator may be appropriate; if it is Firefox chrome, it is not.
  4. Update deliberately: if you test a newer Playwright version, install and verify it in the project or CI environment that runs the test. The 2023 answer is useful historical context, but it does not identify a current minimum fixed version.

The report does not name a release number that can safely be treated as the universal cutoff. Avoid pinning a version based solely on the word “canary” in that answer; verify the behavior of the versions you actually deploy.

Manage the translation offer in Firefox when you do not need it

If the aim is to stop Firefox from offering translation during an automation run, changing Firefox’s translation settings is a more direct route than trying to click browser chrome from page code. Mozilla’s Firefox Translations help page, marked last updated June 7, 2026, explains that translation prompts can be managed for a language or site. It also notes: “Always offer to translate controls whether the panel opens automatically.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Use the settings that match your test’s purpose. If translation itself is not under test, suppressing the relevant offer can make a run less disruptive. If the test is intended to verify Firefox’s translation experience, disabling the offer would hide the behavior you mean to test; use a separate test profile or preserve the prompt instead. Firefox menu wording and settings locations can change between versions, so follow the translation controls present in the build you are testing rather than relying on a fixed menu path from another release.

Mozilla also documents a manual control for a selected-text translation popup: click Done to close it. That describes how a person can use the Firefox panel; it does not create a Playwright page locator for the panel.

Pass Firefox preferences at launch only after verifying the preference

Playwright supports supplying Firefox user preferences with the firefoxUserPrefs launch option; see the BrowserType documentation. The available evidence does not establish which exact preference key controls this Nightly popup in a current build. Do not copy an unverified key into a test and assume it is supported or effective.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

The following is a valid configuration shape, but intentionally contains no preference key: select and verify the preference for the exact Firefox version you use before adding it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const { firefox } = require('playwright');

(async () => {
  const browser = await firefox.launch({
    headless: false,
    firefoxUserPrefs: {
      // Add a Firefox preference only after verifying the key and value
      // for the Firefox build used by this test.
    },
  });

  const page = await browser.newPage();
  await page.goto('https://example.com');
  // Run page-level assertions here. This does not click Firefox chrome.
  await browser.close();
})();

An empty preferences object does not disable translation; it demonstrates the supported launch-option location without inventing a setting. Once you identify a relevant preference from documentation or a controlled test for your Firefox build, add it here and verify that it changes the behavior you intend. Keep the preference scoped to the automation context if you do not want to change a person’s normal Firefox settings.

When a Playwright locator is the right solution

If inspection shows that the prompt is actually rendered by the website, use a locator for the page element and wait for it to become actionable. For example, the following pattern is appropriate only when a button labelled “Cancel” is genuinely part of the page DOM:

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
const cancelButton = page.getByRole('button', { name: 'Cancel' });
await cancelButton.waitFor({ state: 'visible' });
await cancelButton.click();

This is not a workaround for the Firefox-owned translation panel. Do not replace the locator with a JavaScript dialog handler unless the thing being handled is actually a JavaScript dialog. Playwright’s dialog events are for the browser’s handling of page-triggered JavaScript dialogs, not arbitrary browser interface panels.

Common failure modes and what to do

  • “Cancel” cannot be found: the visible control may belong to Firefox, not the website. Confirm whether it appears in page content; if it is browser chrome, manage the offer through Firefox settings or a verified launch preference instead of a page locator.
  • Escape leaves the popup open: the reported Nightly case behaved this way. Escape is not a reliable dismissal method for this panel; use Firefox’s translation controls or check the tested version combination.
  • A dialog handler never fires: a translation panel is not one of the JavaScript dialogs covered by Playwright’s Dialog API. Use that API only for page-created alert, confirm, prompt, or before-unload dialogs.
  • A preference appears to do nothing: first verify the preference key and value against the exact Firefox build. The launch option is supported, but the key for this popup is not established by the sources cited here.
  • The panel returns after updating: record both browser and Playwright versions and test them together. The Stack Overflow answer’s canary fix was reported on November 3, 2023; it does not promise that a later configuration, different Nightly build, or unrelated popup issue is fixed.
  • The panel overlaps other interface: Mozilla Bugzilla Bug 1880685 describes an issue involving overlap between Firefox translation offers and other UI. Treat that as context for investigating the Firefox interface, not as proof that a particular Playwright locator or preference will resolve your case.
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 real goal is to save a clean image of a webpage—not to test or control Firefox Nightly’s own interface—a screenshot API can avoid launching a local browser for that capture. ScreenshotNeo is a website screenshot API and MCP server; it does not dismiss Firefox chrome or replace a Playwright test of Firefox’s translation behavior.

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

One GET request returns an image or PDF. For example, this cURL command saves a WebP capture of the target page. See the ScreenshotNeo API documentation for request options.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Before capture, ScreenshotNeo can accept the cookie or consent banner as a visitor and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks, CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and responses report page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month with no card.

Frequently Asked Questions

Does Playwright support launching Firefox with its own browser preferences?

Yes. Playwright documents the firefoxUserPrefs launch option; the preference key and value for this particular popup still need to be verified for the Firefox build in use.

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

Can a screenshot API close the Firefox Nightly translation popup?

No. ScreenshotNeo captures webpages; it is not a control for Firefox browser chrome. Use it only if the actual task is capturing a webpage rather than testing or dismissing Firefox’s interface.

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.