Skip to content

Conversation

@wswebcreation
Copy link
Member

@wswebcreation wswebcreation commented Nov 21, 2025

Safari Driver on macOS returns screenshots that include the native window mask. This adds rounded corners at the bottom and a soft shadow at the top. Both elements come from the macOS window compositor and cannot be disabled through WebDriver capabilities or Safari settings.

These visual artifacts cause incorrect calculations when determining the viewable area for full page screenshots. The extra masked and shadowed regions lead to wrong scroll positions and incorrect stitching results.

This change adds a correction step for Safari on macOS:

  • Detect the pixel area affected by the window mask at the bottom
  • Detect the pixel area affected by the top window shadow
  • Trim both areas to isolate the true viewable region
  • Use the corrected region for full page screenshot calculations and stitching
  • Produce a clean and fully rectangular image that matches the actual content area

and fixes #1074

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

🦋 Changeset detected

Latest commit: 77bf0cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@wdio/image-comparison-core Patch
@wdio/visual-service Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@wswebcreation wswebcreation marked this pull request as ready for review November 21, 2025 05:40
@wswebcreation wswebcreation merged commit 79d2b1d into main Nov 21, 2025
11 checks passed
@wswebcreation wswebcreation deleted the ws/desktop-safari-fullpage-bezel-issue branch November 21, 2025 06:22
@github-actions github-actions bot mentioned this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Safari fullpage desktop screenshots include window mask and top shadow

2 participants