fluttercommunity / fluttercommunity/flutter_webview_plugin

userAgent parameter does not affect on iPadOS

Open
#762 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.5k
Forks
938
PR merge metrics
No merged PRs in 30d

Description

## System info

Issue occurs on: iOS (iPadOS)
Plugin version: 0.3.11
Flutter doctor output:

```
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.2, on Mac OS X 10.15.4 19E287, locale ja-JP)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 11.5)
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[✓] Android Studio (version 4.0)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ Android Studio not found at /Users/oboenikui/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/193.6453388/Android Studio 4.0 Preview.app/Contents
[✓] Android Studio (version 4.0)
[!] Android Studio
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
[!] VS Code (version 1.45.0)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)

! Doctor found issues in 4 categories.
```

## Steps to Reproduce

1. Open `Settings` App > `Safari` > `Request Desktop Website` > Check `Other Websites` on iPad
2. Run example app
3. Tap `Open Webview (rect)`
4. Tap `Eval some javascript`

## Logs

See eval result below

![image](https://user-images.githubusercontent.com/3191462/83436690-3f680080-a479-11ea-9132-bd5f56eaba68.png)

## Solution

When I use WKWebView#customUserAgent instead, the problem is solved.

https://developer.apple.com/documentation/webkit/wkwebview/1414950-customuseragent

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the example app flow using “Open Webview (rect)” and “Eval some javascript,” then trace how the plugin handles its userAgent parameter on iPadOS. Compare that behavior with WKWebView#customUserAgent, as suggested in the issue. Done means the configured user agent affects the evaluation result when iPadOS has Request Desktop Website enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
flutter, ios
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.