What's New in Firefox 146?

Firefox version 146 is out! What updates are relevant to web scraping (specifically features that apply to Linux users)?

Relevant changes include:

  • Fractional scaling on Wayland and
  • support for @scope CSS rules.

Fractional Scaling on Wayland

The majority of Linux systems now use Wayland as the default display server. It has inexorably replaced X11. To ease the transition between the two display manager systems some applications have used XWayland, a compatibility layer allowing X11 applications to run on Wayland. In general XWayland was a robust solution to the compatibility problem, but it did have some problems, one of which was fractional scaling (scaling UIs to 125%, 150%, 175 etc. versus 100% or 200%).

Recent versions of Firefox no longer use XWayland, instead running natively on Wayland, but without full support for fractional scaling. Firefox now fully supports fractional scaling on Wayland, so that elements are rendered correctly (sharp and at correct location) regardless of scale.

For most scraping workflows, which extract text or data directly from the DOM, this change won’t make much difference. But if you rely on pixel-accurate rendering (for example, capturing screenshots, performing OCR, comparing visual layouts or interacting with elements based on computed coordinates) the improved fractional scaling support can have a meaningful impact on accuracy and reliability.

Scraping aside, the Firefox UI should now look great at all scales!

CSS Scope Rule

Firefox now support the @scope rule, a flexible but precise way to apply CSS selectors only within a specific subset of the DOM. How it works is best explained with an example.

<html>
  <body>
    <div class="profile">
      <h2></h2>              <!-- GREEN -->
      <p></p>                <!-- RED -->
      <div class="details">
        <p></p>              <!-- RED -->
      </div>
      <div class="footer">
        <p></p>              <!-- not RED (below limit) -->
      </div>
    </div>
    <div class="extra">
      <h2></h2>              <!-- not GREEN (outside scope) -->
      <p></p>                <!-- not RED (outside scope) -->
    </div>
  </body>
</html>

The @scope rule is an at-rule, used to group and structure other style rules (and potentially other nested at-rules). The rule below will apply only to <h2> tags within the scope of the .profile class.

@scope (.profile) {
  h2 {color: green;}
}

The rule must contain a root (in the above example this is the .profile class) but may also contain a limit (the .footer class in the example below), which define the upper and lower bounds of the scope. The rule below applies only to <p> tags below the .profile class but above the .footer class in the DOM hierarchy.

@scope (.profile) to (.footer) {
  p {color: red;}
}

The @scope rule is not directly relevant to crafting CSS selectors for content extraction. You can’t use it with BeautifulSoup. But in the case of browser automation (using Playwright or Selenium), where you are interacting with the rendered page content and visibility is important, this rule may determine what and how content is displayed.

Summary

For web scraping and browser automation, the Firefox 146 changes that matter most are those that influence rendering consistency and DOM-level styling behaviour. Firefox now supports fractional scaling under Wayland, which improves layout accuracy and makes pixel-based operations (such as screenshot comparison, OCR extraction and click-coordinate targeting) more reliable. Firefox also adds support for the @scope CSS rule, allowing sites to isolate styles within specific DOM sub-trees. While this doesn’t affect static HTML parsing, it can change computed styles and visibility in browser-based scrapers, especially on sites that rely on sophisticated or obfuscated CSS. Together, these updates make Firefox more predictable when automating scraping tasks on dynamic or visually complex pages.