apache / apache/cordova-plugin-inappbrowser
OverrideUserAgent and AppendUserAgent not working for Android
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 2.2k
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
Tried changing the webview UserAgent in config.xml. used both
```
```
in config.xml for both android and iOS preferences. Its working fine for iOS but not working for android.
### What is expected to happen?
it should should change the userAgent to given OverrideUserAgent value
### What does actually happen?
Its not changing for android.
## Information
Tried debugging the generated code. Its giving null values for both OverrideUserAgent and AppendUserAgent preferences in SystemWebViewEngine.Java class
### Command or Code
```
**config.xml**
xxxxxx
xxxxxx
xxxxxx
```
### Environment, Platform, Device
Android
### Version information
Android targeted SDK 29
cordova-lib@9.0.1
cordova-plugin-inappbrowser 4.0.0
**platforms list:**
android@8.1.0
ios@4.5.5
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
Start in SystemWebViewEngine.java and trace how OverrideUserAgent and AppendUserAgent are read from the Android preferences, reproducing the reported null values with the supplied config.xml and Android 8.1.0 setup. Done means the Android WebView applies the configured override or appended user agent, while the relevant behavior is verified against the issue’s reproduction case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100