Skip to content

[Android] BlazorWebView: Resolve intent links through browsable activities - #38079

Merged
kubaflo merged 3 commits into
inflight/currentfrom
mattleibow-investigate-ticket-repro
Sep 2, 2026
Merged

kubaflo merged 3 commits into
inflight/currentfrom
mattleibow-investigate-ticket-repro

Conversation

@mattleibow

@mattleibow mattleibow commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Description of Change

Android BlazorWebView parsed structured intent links and started the resulting Intent unchanged. This meant component, selector, and activity flag fields were treated as direct launch instructions rather than being resolved through browser-capable activities.

This bug fix keeps intent: and android-app: links working while aligning their launch behavior with Android browser activity resolution:

  • Clears explicit component and selector targets.
  • Requires handlers to declare CATEGORY_BROWSABLE.
  • Limits activity flags to the set supported by Chromium for external intents.
  • Preserves package, custom action, data, categories, and typed extras.
  • Leaves ordinary https:, tel:, mailto:, and geo: links as ACTION_VIEW intents.

Android device tests exercise real activity resolution for explicit targets, browsable and non-browsable handlers, structured routing data, typed extras, allowed activity flags, and common URI schemes.

Testing

  • MauiBlazorWebView.DeviceTests on Android: 46 run, 42 passed, 0 failed, 4 ignored.
  • MauiBlazorWebView.DeviceTests iOS simulator build succeeded.
  • Android Microsoft.AspNetCore.Components.WebView.Maui build succeeded with CA1416 treated as an error.

Issues Fixed

N/A

Copilot AI lite review requested due to automatic review settings September 1, 2026 21:18
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38079

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38079"

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI 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.

🔵 Needs a closer look

Pull request overview

This PR updates Android BlazorWebView external-navigation handling so structured intent: and android-app: links are launched via normal browsable activity resolution (instead of honoring explicit component/selector targets from the URI), aligning behavior with how Android browsers resolve external intents.

Changes:

  • Introduced WebKitWebViewClient.CreateIntentForExternalUri to normalize/secure structured intent URIs by adding CATEGORY_BROWSABLE, clearing component/selector, and masking intent flags.
  • Added Android device tests and supporting test Activities to validate intent parsing and real activity resolution behavior (browsable vs non-browsable handlers, extras, and allowed flags).
  • Granted DeviceTests access to internal APIs in the BlazorWebView Maui assembly for targeted intent creation testing.
File summaries
File Description
src/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cs Centralizes intent creation for external URIs and applies browsable-resolution normalization for intent:/android-app: schemes.
src/BlazorWebView/tests/DeviceTests/Elements/BlazorWebViewTests.ExternalNavigation.Android.cs Adds Android device tests covering intent parsing, explicit-target stripping, flags masking, and resolution outcomes.
src/BlazorWebView/tests/DeviceTests/Platforms/Android/ExternalNavigationTestActivities.cs Adds Android test Activities + launch monitor utilities used by the device tests to observe real resolution/launch behavior.
src/BlazorWebView/src/Maui/Properties/AssemblyInfo.cs Adds InternalsVisibleTo to allow device tests to call internal intent creation logic.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

@mattleibow

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Sep 1, 2026
@MauiBot

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Sep 2, 2026
@mattleibow

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Sep 2, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 1 findings

See inline comments for details.

MauiBot

This comment was marked as outdated.

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) and removed s/agent-review-in-progress AI review is currently running for this PR labels Sep 2, 2026
Copilot AI review requested due to automatic review settings September 2, 2026 03:40
@mattleibow

This comment has been minimized.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR s/agent-review-in-progress AI review is currently running for this PR labels Sep 2, 2026
mattleibow and others added 3 commits September 2, 2026 18:20
…ities

Keep structured intent URI handling aligned with browser activity resolution by clearing explicit targets and limiting task flags while preserving registered handlers, routing data, and ordinary external URI behavior.

Add Android device coverage for browsable and non-browsable handlers, explicit targets, structured URI fields, and common URI schemes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Wait for the marked test host document before executing external navigation instead of requiring Blazor initialization, so the activity-resolution path is exercised directly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Use the DeviceTests platform suffix convention so the Android activity fixture is compiled only for the Android target.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
@mattleibow
mattleibow force-pushed the mattleibow-investigate-ticket-repro branch from 6ccdfa9 to e1db903 Compare September 2, 2026 16:20
Copilot AI review requested due to automatic review settings September 2, 2026 16:21
@mattleibow
mattleibow changed the base branch from main to inflight/current September 2, 2026 16:21
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Skill Validation Results

@mattleibow — new skill validation results are available based on this last commit: e1db903.
To request a fresh validation after new comments or commits, comment /evaluate-skills.

Overall Passed Static Passed LLM Skipped Skills 24 Agents 6

✅ Skill Validation Results — e1db903 · [Android] BlazorWebView: Resolve intent links through browsable activities · 2026-09-02T16:22:50Z

✅ Static Checks Passed

Skills: 24 | Eval specs linted: 16

Full lint output
── .github/skills/agentic-labeler/tests/eval.vally.yaml
Vally collects pseudonymous usage telemetry (command name, version, outcome, duration, persistent device identifier (when available), and coarse OS/runtime info) to improve the product. No prompts, datasets, file paths, or arguments are collected.
Opt out any time by setting VALLY_TELEMETRY_OPTOUT=1 or DO_NOT_TRACK=1.
Learn more: https://aka.ms/vally/telemetry
✔ .github/skills/agentic-labeler/tests/eval.vally.yaml is valid
── .github/skills/analyze-sessions/tests/eval.vally.yaml
✔ .github/skills/analyze-sessions/tests/eval.vally.yaml is valid
── .github/skills/ci-fix/tests/eval.ownership.vally.yaml
✔ .github/skills/ci-fix/tests/eval.ownership.vally.yaml is valid
── .github/skills/ci-fix/tests/eval.vally.yaml
✔ .github/skills/ci-fix/tests/eval.vally.yaml is valid
── .github/skills/code-review/tests/eval.inline-findings.vally.yaml
✔ .github/skills/code-review/tests/eval.inline-findings.vally.yaml is valid
── .github/skills/code-review/tests/eval.producer-trace.vally.yaml
✔ .github/skills/code-review/tests/eval.producer-trace.vally.yaml is valid
── .github/skills/code-review/tests/eval.trim-aot.vally.yaml
✔ .github/skills/code-review/tests/eval.trim-aot.vally.yaml is valid
── .github/skills/code-review/tests/eval.vally.yaml
✔ .github/skills/code-review/tests/eval.vally.yaml is valid
── .github/skills/code-review/tests/hermeticity.vally.yaml
✔ .github/skills/code-review/tests/hermeticity.vally.yaml is valid
── .github/skills/code-review/tests/soak.capability.vally.yaml
✔ .github/skills/code-review/tests/soak.capability.vally.yaml is valid
── .github/skills/evaluate-pr-tests/tests/eval.vally.yaml
✔ .github/skills/evaluate-pr-tests/tests/eval.vally.yaml is valid
── .github/skills/pr-review/tests/eval.gh-auth.vally.yaml
✔ .github/skills/pr-review/tests/eval.gh-auth.vally.yaml is valid
── .github/skills/try-fix/tests/eval.restore.vally.yaml
✔ .github/skills/try-fix/tests/eval.restore.vally.yaml is valid
── .github/skills/try-fix/tests/eval.vally.yaml
✔ .github/skills/try-fix/tests/eval.vally.yaml is valid
── .github/skills/verify-tests-fail-without-fix/tests/eval.protocol.vally.yaml
✔ .github/skills/verify-tests-fail-without-fix/tests/eval.protocol.vally.yaml is valid
── .github/skills/verify-tests-fail-without-fix/tests/eval.vally.yaml
✔ .github/skills/verify-tests-fail-without-fix/tests/eval.vally.yaml is valid

⏭️ LLM Evaluation: Skipped

No changed skills with eval specs found.

🔍 Full results and investigation steps

Copilot AI 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.

🟢 Approval recommended

The implementation matches the stated intent-resolution behavior and is backed by focused Android device tests without any evident correctness issues in the reviewed diffs.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@kubaflo
kubaflo merged commit 2c550d1 into inflight/current Sep 2, 2026
14 of 24 checks passed
@kubaflo
kubaflo deleted the mattleibow-investigate-ticket-repro branch September 2, 2026 16:33
kubaflo pushed a commit that referenced this pull request Sep 2, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo added a commit that referenced this pull request Sep 2, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
kubaflo added a commit that referenced this pull request Sep 3, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
kubaflo pushed a commit that referenced this pull request Sep 3, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo added a commit that referenced this pull request Sep 4, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
kubaflo pushed a commit that referenced this pull request Sep 6, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo pushed a commit that referenced this pull request Sep 7, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo added a commit that referenced this pull request Sep 7, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
kubaflo pushed a commit that referenced this pull request Sep 8, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo added a commit that referenced this pull request Sep 8, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
kubaflo pushed a commit that referenced this pull request Sep 9, 2026
…ities (#38079)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Android `BlazorWebView` parsed structured intent links and started the
resulting `Intent` unchanged. This meant component, selector, and
activity flag fields were treated as direct launch instructions rather
than being resolved through browser-capable activities.

This bug fix keeps `intent:` and `android-app:` links working while
aligning their launch behavior with Android browser activity resolution:

- Clears explicit component and selector targets.
- Requires handlers to declare `CATEGORY_BROWSABLE`.
- Limits activity flags to the set supported by Chromium for external
intents.
- Preserves package, custom action, data, categories, and typed extras.
- Leaves ordinary `https:`, `tel:`, `mailto:`, and `geo:` links as
`ACTION_VIEW` intents.

Android device tests exercise real activity resolution for explicit
targets, browsable and non-browsable handlers, structured routing data,
typed extras, allowed activity flags, and common URI schemes.

### Testing

- `MauiBlazorWebView.DeviceTests` on Android: 46 run, 42 passed, 0
failed, 4 ignored.
- `MauiBlazorWebView.DeviceTests` iOS simulator build succeeded.
- Android `Microsoft.AspNetCore.Components.WebView.Maui` build succeeded
with CA1416 treated as an error.

### Issues Fixed

N/A

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
kubaflo added a commit that referenced this pull request Sep 9, 2026
…38126)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

Backports #38079 and #38078 to `inflight/candidate`.

### Changes

- Backports the Android `BlazorWebView` intent-link resolution fix from
#38079.
- Backports the cross-platform `HybridWebView` message-origin validation
fix from #38078.
- Includes the device-test coverage from both source PRs.

The landed squash commits were cherry-picked in landing order without
conflicts.

### Validation

- `dotnet build Microsoft.Maui.BuildTasks.slnf -c Debug`
- `dotnet build
src/BlazorWebView/tests/DeviceTests/MauiBlazorWebView.DeviceTests.csproj
-f net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-android -c Debug`
- `dotnet build
src/Controls/tests/DeviceTests/Controls.DeviceTests.csproj -f
net10.0-maccatalyst -c Debug`
- Windows cross-build reaches the Windows-only `MakePri.exe` step and
cannot complete on macOS.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2a40510-33c4-4ff0-87f3-535f4a7e98a3
Copilot-Session: a5d3b169-5cb5-440d-a4ba-22e39d132876
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-blazor Blazor Hybrid / Desktop, BlazorWebView platform/android s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants