This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] Resolve OS as iOs for iDevice Safari requesting desktop version of app.#25957
Merged
fluttergithubbot merged 2 commits intoflutter:masterfrom May 11, 2021
ditman:fix-ipad-ua-detection
Merged
[web] Resolve OS as iOs for iDevice Safari requesting desktop version of app.#25957fluttergithubbot merged 2 commits intoflutter:masterfrom ditman:fix-ipad-ua-detection
fluttergithubbot merged 2 commits intoflutter:masterfrom
ditman:fix-ipad-ua-detection
Conversation
yjbanov
approved these changes
May 5, 2021
| OperatingSystem _detectOperatingSystem() { | ||
| final String platform = html.window.navigator.platform!; | ||
| final String userAgent = html.window.navigator.userAgent; | ||
| @visibleForTesting |
Contributor
There was a problem hiding this comment.
FWIW, I stopped using @visibleForTesting. Making things public in the engine code is fine because the entire library becomes private later in the process (dart:_engine).
Member
Author
There was a problem hiding this comment.
This file hasn't been cleaned up yet, it uses @visibleForTesting for the other tested method, I'm going to leave this here until we remove all. Also, if we ever move to import/export we don't have to touch this again :P
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 11, 2021
fluttergithubbot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 12, 2021
… version of app. (flutter/engine#25957) (#82300)
naudzghebre
pushed a commit
to naudzghebre/engine
that referenced
this pull request
May 21, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR tweaks the OS detection code in Flutter web, so iDevices requesting flutter apps in "desktop mode" (spoofing their navigator attributes) are still correctly identified as iDevices, and not confused with "Macs".
I've also added tests for the OS detection code.
Fixes flutter/flutter#81918
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.