Skip to content

Mark the Device Posture API as unsupported in WebView Android - #31033

Merged
Elchi3 merged 1 commit into
mdn:mainfrom
Manishram-ai:webview-device-posture
Nov 3, 2026
Merged

Elchi3 merged 1 commit into
mdn:mainfrom
Manishram-ai:webview-device-posture

Conversation

@Manishram-ai

Copy link
Copy Markdown
Contributor

Summary

WebView Android doesn't expose the Device Posture API, so this sets webview_android to false for api.Navigator.devicePosture and api.DevicePosture (and its type and change_event) instead of mirroring Chrome.

Test results and supporting details

Chromium turns the API off for WebView in aw_field_trials.cc:

// Disable device posture API as the framework implementation causes
// AwContents to leak in apps that don't call destroy().
aw_feature_overrides.DisableFeature(blink::features::kDevicePosture);

That line landed in May 2024 (CL 5548161, crbug.com/335314107), before Chrome 132 shipped the API, so WebView never had it. This matches the test in #30973: 'devicePosture' in navigator is false in WebView 155 and true in Chrome on the same phone.

I left the device-posture media feature as it is, since #30973 shows it working in WebView.

The same Chromium change also turns off kViewportSegments, so api.Viewport.segments may have the same problem in WebView. I haven't tested that one.

Related issues

Fixes #30973

@github-actions github-actions Bot added data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API size:s Pull request changing 7-24 lines of code. labels Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@Elchi3 Elchi3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! 👍

@Elchi3
Elchi3 merged commit 0c0088f into mdn:main Nov 3, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:api Compatibility data for Web API features. https://developer.mozilla.org/docs/Web/API size:s Pull request changing 7-24 lines of code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

api.Navigator.devicePosture / api.DevicePosture - not supported in WebView Android (data is mirrored from Chrome)

2 participants