Skip to content

feat(mac/v2): expose mediaTypesRequiringUserActionForPlayback on WKWebView#5512

Open
Eyalm321 wants to merge 3 commits into
wailsapp:masterfrom
Eyalm321:fix/macos-media-playback-options-v2
Open

feat(mac/v2): expose mediaTypesRequiringUserActionForPlayback on WKWebView#5512
Eyalm321 wants to merge 3 commits into
wailsapp:masterfrom
Eyalm321:fix/macos-media-playback-options-v2

Conversation

@Eyalm321

@Eyalm321 Eyalm321 commented May 27, 2026

Copy link
Copy Markdown

Summary

Adds EnableAutoplayWithoutUserAction to mac.Preferences, mapping to WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback. Without it, there is no way to autoplay HTML5 video/audio in a Wails v2 macOS app — every <video autoplay> is blocked.

Closes #5511.

Implementation

Mirrors the existing preference-passing pattern (compare TabFocusesLinks, FullscreenEnabled):

  1. Add EnableAutoplayWithoutUserAction u.Bool to mac.Preferences (v2/pkg/options/mac/preferences.go)
  2. Add bool *enableAutoplayWithoutUserAction to the C struct Preferences (WailsContext.h)
  3. Wire through the Go side via IsSet() + bool2CboolPtr(...) (window.go)
  4. Apply on WKWebViewConfiguration when set:
    if (preferences.enableAutoplayWithoutUserAction != NULL && *preferences.enableAutoplayWithoutUserAction) {
        config.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone;
    }

Defaults preserve WebKit's current behaviour (user gesture required) — opt-in only.

iOS in v3 already exposes the equivalent option (EnableAutoplayWithoutUserAction in application_options.go), and the same gap is being filled for v3 macOS in a parallel PR.

Note: allowsInlineMediaPlayback is iOS-only on WKWebViewConfiguration (verified by macos-latest compile failure with Xcode 16.4 SDK), so it is intentionally not exposed on macOS.

Test plan

  • Build on macOS (validated via fork CI on macos-latest / Xcode 16.4)
  • Manual: a v2 app with <video autoplay src="..."> and Mac.Preferences.EnableAutoplayWithoutUserAction: mac.Enabled autoplays without a click
  • Regression: unset/false preserves prior behaviour (gesture required)

Summary by CodeRabbit

  • New Features

    • Added a macOS preference to allow HTML5 media to autoplay without a user gesture, letting apps opt into automatic playback while preserving default behavior when disabled.
  • Documentation

    • Updated macOS preferences documentation and changelog to describe the new autoplay option.

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR adds macOS media autoplay support to Wails v2 by introducing a new user-facing preference, bridging it through C to Objective‑C, and applying it directly to WebKit's audio/visual media configuration during window creation.

Changes

macOS Media Autoplay Feature

Layer / File(s) Summary
Public macOS autoplay option
v2/pkg/options/mac/preferences.go, website/docs/reference/options.mdx, website/src/pages/changelog.mdx
Preferences adds EnableAutoplayWithoutUserAction with docs and examples; changelog documents the new macOS webview preference.
Go-to-C bridge for autoplay
v2/internal/frontend/desktop/darwin/WailsContext.h, v2/internal/frontend/desktop/darwin/window.go
C struct Preferences gains enableAutoplayWithoutUserAction pointer; Go NewWindow reads the option and forwards its value into the C struct before window creation.
WebKit autoplay configuration
v2/internal/frontend/desktop/darwin/WailsContext.m
CreateWindow conditionally sets config.mediaTypesRequiringUserActionForPlayback to WKAudiovisualMediaTypeNone when the bridged preference is present and enabled.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

Documentation, MacOS, v2-only, reviewed ✅

Suggested reviewers

  • leaanthony

Poem

🐰 A little rabbit hops through code so bright,
Toggling autoplay to bring videos to light.
No click to start, just a gentle cheer,
Media flows freely — the developer's dear.
Hooray for playback, smooth and light!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: exposing mediaTypesRequiringUserActionForPlayback on WKWebView for macOS v2, which is the primary objective of the PR.
Description check ✅ Passed The description comprehensively covers the change, includes a 'Fixes #5511' reference, explains the implementation approach, lists completed testing (macOS build), and provides a clear test plan with expected behavior.
Linked Issues check ✅ Passed The PR fully addresses the coding requirements from #5511: adds EnableAutoplayWithoutUserAction to mac.Preferences, wires it through C/ObjC, applies mediaTypesRequiringUserActionForPlayback when enabled, updates docs, and adds changelog entry. allowsInlineMediaPlayback is intentionally excluded due to iOS-only API.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the EnableAutoplayWithoutUserAction preference for macOS v2: Go bindings, C headers, Objective-C implementation, documentation, and changelog—with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/build-macos-media-playback.yml (1)

18-23: ⚖️ Poor tradeoff

Consider pinning actions to commit SHAs.

Pinning to commit hashes prevents supply-chain attacks via tag/version manipulation.

Example with SHA pinning
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
         with:
           persist-credentials: false
 
-      - uses: actions/setup-go@v5
+      - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0

You can find the commit SHAs for specific versions in each action's repository release page.

Also applies to: 43-48

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-macos-media-playback.yml around lines 18 - 23,
Replace floating action tags with immutable commit SHAs: locate the occurrences
of "uses: actions/checkout@v4" and "uses: actions/setup-go@v4" (and the other
occurrences flagged around lines 43-48) and change them to the corresponding
commit SHA references from each action's GitHub repo (e.g.,
actions/checkout@<commit-sha> and actions/setup-go@<commit-sha>); update the
workflow comments to note the chosen SHAs and, if desired, add a short note or
workflow-level variable that documents the original tag version for future
updates.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-macos-media-playback.yml:
- Line 20: Replace the outdated runner reference "uses: actions/setup-go@v4"
with "uses: actions/setup-go@v5" wherever it appears in the workflow (there are
two occurrences of the literal "uses: actions/setup-go@v4"); update both
instances so the workflow uses actions/setup-go@v5.
- Line 18: Update the checkout steps that use the action identifier "uses:
actions/checkout@v4" to include the option persist-credentials: false so
credentials are not persisted in the workspace; apply this change to each
checkout step occurrence (including the second occurrence referenced in the
review) by adding the persist-credentials: false key under the same job/step
that calls actions/checkout@v4.
- Around line 1-9: Add an explicit top-level GitHub Actions permissions block
for the "Build darwin (media-playback options)" workflow (the YAML with the
name: Build darwin (media-playback options) and the on: section) to restrict the
OIDC token scope; include only the minimal required permissions such as
contents: read and packages: read (and add id-token: write only if the workflow
needs OIDC), placing the permissions stanza at the top-level of the workflow
file.

---

Nitpick comments:
In @.github/workflows/build-macos-media-playback.yml:
- Around line 18-23: Replace floating action tags with immutable commit SHAs:
locate the occurrences of "uses: actions/checkout@v4" and "uses:
actions/setup-go@v4" (and the other occurrences flagged around lines 43-48) and
change them to the corresponding commit SHA references from each action's GitHub
repo (e.g., actions/checkout@<commit-sha> and actions/setup-go@<commit-sha>);
update the workflow comments to note the chosen SHAs and, if desired, add a
short note or workflow-level variable that documents the original tag version
for future updates.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85a2b43e-54c3-4dce-a8e9-db080071f2e3

📥 Commits

Reviewing files that changed from the base of the PR and between 6329e9d and 20bd946.

📒 Files selected for processing (5)
  • .github/workflows/build-macos-media-playback.yml
  • v2/internal/frontend/desktop/darwin/WailsContext.h
  • v2/internal/frontend/desktop/darwin/WailsContext.m
  • v2/internal/frontend/desktop/darwin/window.go
  • v2/pkg/options/mac/preferences.go

Comment thread .github/workflows/build-macos-media-playback.yml Outdated
Comment thread .github/workflows/build-macos-media-playback.yml Outdated
Comment thread .github/workflows/build-macos-media-playback.yml Outdated
@Eyalm321 Eyalm321 force-pushed the fix/macos-media-playback-options-v2 branch from 20bd946 to bf58079 Compare May 27, 2026 21:34
Add EnableAutoplayWithoutUserAction to mac.Preferences, mapping to
WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback.

Without this option, there is no way to autoplay HTML5 video/audio in
a Wails v2 macOS app — every <video autoplay> is blocked by WebKit's
user-gesture requirement.

Follows the existing pattern used for TabFocusesLinks, FullscreenEnabled
etc.: u.Bool option, bool* in the C struct, applied on WKWebViewConfiguration
when set. Defaults preserve current WebKit behaviour (gesture required) —
opt-in only.

iOS already exposes the equivalent (EnableAutoplayWithoutUserAction in
v3 application_options.go); this brings v2 macOS to parity.

Closes wailsapp#5511

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (3)
.github/workflows/build-macos-media-playback.yml (3)

20-20: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

actions/setup-go@v4 is outdated and can fail the workflow.

At Line 20 and Line 45, bump to actions/setup-go@v5.

Suggested patch
-      - uses: actions/setup-go@v4
+      - uses: actions/setup-go@v5
...
-      - uses: actions/setup-go@v4
+      - uses: actions/setup-go@v5

Also applies to: 45-45

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-macos-media-playback.yml at line 20, Replace the
outdated GitHub Actions step using actions/setup-go@v4 with actions/setup-go@v5
in the workflow file: locate the occurrences of the runner step that reads
"uses: actions/setup-go@v4" (found at the instances around the top-level steps,
including the lines referenced) and update the version tag to
"actions/setup-go@v5" for both occurrences so the workflow uses the current
setup-go action.

18-18: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Disable credential persistence on checkout.

At Line 18 and Line 43, set persist-credentials: false to reduce token exposure across later steps/artifacts.

Suggested patch
       - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
...
       - uses: actions/checkout@v4
+        with:
+          persist-credentials: false

Also applies to: 43-43

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-macos-media-playback.yml at line 18, Update the
GitHub Actions checkout steps to disable credential persistence by adding
persist-credentials: false to each actions/checkout@v4 invocation; specifically
modify the checkout step(s) referenced (the steps that call actions/checkout@v4
at both occurrences) to include the persist-credentials: false key so tokens are
not automatically persisted to later steps or artifacts.

1-9: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add least-privilege workflow permissions.

There is no top-level permissions block, so the workflow inherits broader defaults. Add minimal read-only scope unless a job explicitly needs more.

Suggested patch
 name: Build darwin (media-playback options)
 
+permissions:
+  contents: read
+
 on:
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-macos-media-playback.yml around lines 1 - 9, Add a
top-level GitHub Actions permissions block to this workflow (name "Build darwin
(media-playback options)") to enforce least-privilege access by setting minimal
read-only scopes (e.g., set contents: read) at the root of the YAML; if any job
or step (refer to job names in this workflow) requires broader rights, grant
only the specific additional permissions on that job via its own permissions
map.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In @.github/workflows/build-macos-media-playback.yml:
- Line 20: Replace the outdated GitHub Actions step using actions/setup-go@v4
with actions/setup-go@v5 in the workflow file: locate the occurrences of the
runner step that reads "uses: actions/setup-go@v4" (found at the instances
around the top-level steps, including the lines referenced) and update the
version tag to "actions/setup-go@v5" for both occurrences so the workflow uses
the current setup-go action.
- Line 18: Update the GitHub Actions checkout steps to disable credential
persistence by adding persist-credentials: false to each actions/checkout@v4
invocation; specifically modify the checkout step(s) referenced (the steps that
call actions/checkout@v4 at both occurrences) to include the
persist-credentials: false key so tokens are not automatically persisted to
later steps or artifacts.
- Around line 1-9: Add a top-level GitHub Actions permissions block to this
workflow (name "Build darwin (media-playback options)") to enforce
least-privilege access by setting minimal read-only scopes (e.g., set contents:
read) at the root of the YAML; if any job or step (refer to job names in this
workflow) requires broader rights, grant only the specific additional
permissions on that job via its own permissions map.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 01eaee00-77e6-49e6-bf80-f93f014163cc

📥 Commits

Reviewing files that changed from the base of the PR and between 20bd946 and bf58079.

📒 Files selected for processing (5)
  • .github/workflows/build-macos-media-playback.yml
  • v2/internal/frontend/desktop/darwin/WailsContext.h
  • v2/internal/frontend/desktop/darwin/WailsContext.m
  • v2/internal/frontend/desktop/darwin/window.go
  • v2/pkg/options/mac/preferences.go
✅ Files skipped from review due to trivial changes (1)
  • v2/internal/frontend/desktop/darwin/WailsContext.h
🚧 Files skipped from review as they are similar to previous changes (3)
  • v2/internal/frontend/desktop/darwin/window.go
  • v2/pkg/options/mac/preferences.go
  • v2/internal/frontend/desktop/darwin/WailsContext.m

@Eyalm321 Eyalm321 force-pushed the fix/macos-media-playback-options-v2 branch from bf58079 to f39b362 Compare May 27, 2026 21:37
Eyalm321 pushed a commit to Eyalm321/clawdpanel that referenced this pull request May 27, 2026
Pin to a Wails v2 fork that exposes WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback,
then opt in via Mac.Preferences.EnableAutoplayWithoutUserAction.

Without this, every <video>/<audio> tag in the embedded webview required
a click before playback — making things like ambient bar audio unusable.

Fork: github.com/Eyalm321/wails/v2 v2.12.0-mediaplayback.1
Upstream PR: wailsapp/wails#5512

Bumps CI Go to 1.25 to match the fork's go.mod requirement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eyalm321 added a commit to Eyalm321/clawdpanel that referenced this pull request May 28, 2026
Pin to a Wails v2 fork that exposes WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback,
then opt in via Mac.Preferences.EnableAutoplayWithoutUserAction.

Without this, every <video>/<audio> tag in the embedded webview required
a click before playback — making things like ambient bar audio unusable.

Fork: github.com/Eyalm321/wails/v2 v2.12.0-mediaplayback.1
Upstream PR: wailsapp/wails#5512

Bumps CI Go to 1.25 to match the fork's go.mod requirement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@leaanthony

Copy link
Copy Markdown
Member

Thanks for this — the implementation looks good! Before we merge, could you add two things:

  1. Docswebsite/docs/reference/options.mdx has a table for MacWebviewPreferences around line 984 (alongside TabFocusesLinks, TextInteractionEnabled, etc.). Please add a row for EnableAutoplayWithoutUserAction there, following the same pattern with a link to the relevant Apple docs (WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback).

  2. Changelog — a one-line entry in CHANGELOG.md under the next unreleased version.

We'll handle v3 support in a separate follow-up PR once this lands.

@leaanthony

Copy link
Copy Markdown
Member

v3 support has been implemented on branch worktree-feat+mac-v3-wkwebview-p1-options. The following fields are now available in MacWebviewPreferences for v3 (mirroring what this PR adds to v2):

  • EnableAutoplayWithoutUserActionconfig.mediaTypesRequiringUserActionForPlayback = WKAudiovisualMediaTypeNone
  • AllowsAirPlayForMediaPlaybackconfig.allowsAirPlayForMediaPlayback
  • AllowsMagnificationwebView.allowsMagnification
  • JavaScriptCanOpenWindowsAutomaticallyconfig.preferences.javaScriptCanOpenWindowsAutomatically
  • MinimumFontSizeconfig.preferences.minimumFontSize
  • ApplicationNameForUserAgentconfig.applicationNameForUserAgent (falls back to "wails.io" if empty)

This will be merged alongside (or shortly after) this PR.

…g entry

Addresses review feedback on wailsapp#5512:
- Add EnableAutoplayWithoutUserAction row to the MacWebviewPreferences
  table in website/docs/reference/options.mdx (with Apple docs link for
  WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback), and
  list the field in the struct snippet and example for consistency.
- Add an Unreleased "Added" changelog entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
website/docs/reference/options.mdx (3)

983-989: ⚡ Quick win

Consider documenting the ApplicationNameForUserAgent field in the table.

The preferences table is missing a row for the ApplicationNameForUserAgent field. For documentation completeness, consider adding:

Name Description
ApplicationNameForUserAgent A string value used as the application name portion of the user agent. When set to a non-empty value, overrides the default Wails suffix. Useful when sites reject the default identifier.

This would appear between FullscreenEnabled and EnableAutoplayWithoutUserAction to match the struct field order.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/docs/reference/options.mdx` around lines 983 - 989, Add a new table
row documenting the ApplicationNameForUserAgent field: insert a row named
ApplicationNameForUserAgent with the description "A string value used as the
application name portion of the user agent. When set to a non-empty value,
overrides the default Wails suffix. Useful when sites reject the default
identifier." and place it between the existing FullscreenEnabled and
EnableAutoplayWithoutUserAction rows so the table order matches the struct field
order; ensure the formatting matches the other rows and includes the same
link/format style as surrounding entries.

975-981: ⚡ Quick win

Consider adding the missing ApplicationNameForUserAgent field to complete the struct documentation.

The struct code block is missing the ApplicationNameForUserAgent string field that exists in the actual mac.Preferences struct (between FullscreenEnabled and EnableAutoplayWithoutUserAction). Based on the actual implementation, the complete struct should be:

type Preferences struct {
	TabFocusesLinks                 u.Bool
	TextInteractionEnabled          u.Bool
	FullscreenEnabled               u.Bool
	ApplicationNameForUserAgent     string
	EnableAutoplayWithoutUserAction u.Bool
}

Including all fields ensures users have an accurate reference and can discover all available options.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/docs/reference/options.mdx` around lines 975 - 981, The Preferences
struct documentation is missing the ApplicationNameForUserAgent field; update
the code block for type Preferences to include the ApplicationNameForUserAgent
string field between FullscreenEnabled and EnableAutoplayWithoutUserAction so
the docs match the actual mac.Preferences implementation and users can discover
that option.

995-998: ⚡ Quick win

Consider including ApplicationNameForUserAgent in the example for completeness.

The example could demonstrate both boolean and string preference types:

Mac: &mac.Options{
    Preferences: &mac.Preferences{
		TabFocusesLinks:                 mac.Enabled,
		TextInteractionEnabled:          mac.Disabled,
		FullscreenEnabled:               mac.Enabled,
		ApplicationNameForUserAgent:     "MyApp",
		EnableAutoplayWithoutUserAction: mac.Enabled,
	}
}

This would help users understand how to configure string-type preferences alongside the boolean ones.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@website/docs/reference/options.mdx` around lines 995 - 998, Add the string
preference example to the Mac preferences block by including
ApplicationNameForUserAgent in the mac.Preferences example; update the
Preferences literal inside mac.Options to show ApplicationNameForUserAgent:
"MyApp" alongside the existing boolean entries (TabFocusesLinks,
TextInteractionEnabled, FullscreenEnabled, EnableAutoplayWithoutUserAction) so
the doc demonstrates both string- and boolean-typed preference values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@website/docs/reference/options.mdx`:
- Around line 983-989: Add a new table row documenting the
ApplicationNameForUserAgent field: insert a row named
ApplicationNameForUserAgent with the description "A string value used as the
application name portion of the user agent. When set to a non-empty value,
overrides the default Wails suffix. Useful when sites reject the default
identifier." and place it between the existing FullscreenEnabled and
EnableAutoplayWithoutUserAction rows so the table order matches the struct field
order; ensure the formatting matches the other rows and includes the same
link/format style as surrounding entries.
- Around line 975-981: The Preferences struct documentation is missing the
ApplicationNameForUserAgent field; update the code block for type Preferences to
include the ApplicationNameForUserAgent string field between FullscreenEnabled
and EnableAutoplayWithoutUserAction so the docs match the actual mac.Preferences
implementation and users can discover that option.
- Around line 995-998: Add the string preference example to the Mac preferences
block by including ApplicationNameForUserAgent in the mac.Preferences example;
update the Preferences literal inside mac.Options to show
ApplicationNameForUserAgent: "MyApp" alongside the existing boolean entries
(TabFocusesLinks, TextInteractionEnabled, FullscreenEnabled,
EnableAutoplayWithoutUserAction) so the doc demonstrates both string- and
boolean-typed preference values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9e92894e-2060-4925-aa27-e36e0d24fd00

📥 Commits

Reviewing files that changed from the base of the PR and between f39b362 and 62b1e7c.

📒 Files selected for processing (2)
  • website/docs/reference/options.mdx
  • website/src/pages/changelog.mdx
✅ Files skipped from review due to trivial changes (1)
  • website/src/pages/changelog.mdx

@Eyalm321

Eyalm321 commented Jun 7, 2026

Copy link
Copy Markdown
Author

Thanks @leaanthony! Both items are done in 62b1e7c:

  1. Docs — added an EnableAutoplayWithoutUserAction row to the MacWebviewPreferences table in website/docs/reference/options.mdx, following the same pattern with a link to WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback. I also added the field to the struct snippet and example just above the table so the section stays consistent.
  2. Changelog — added a one-line entry under ## [Unreleased] in website/src/pages/changelog.mdx (used that file since the root CHANGELOG.md is just a pointer to wails.io/changelog — let me know if you'd prefer it elsewhere).

Sounds good on v3 being a separate follow-up. Ready for re-review whenever you get a chance.

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.

macOS: expose WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback and allowsInlineMediaPlayback

2 participants