Issue
I can see the following fields in “Device Preferences”.
However, none of these preferences seem to control navigator.userAgent
. I also tried looking into “Device Settings” but that doesn't have any field related to the user agent at all.
For reference, here is my runtime info.
As you can see, the user agent is Mozilla 5.0 (Mobile; rv:48.0) Gecko/48.0 Firefox/48.0
. I want to change the user agent to Mozilla/5.0 (Mobile; LYF/LF-2403/LYF-LF2403-000-01-3D-191217-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.0
to match the device user agent.
Solution
The trick is to treat it like a firefox browser:
- Open "Device Preferences" and add a new string config with key
general.useragent.override
and value as whatever you need. - Restart your app in the simulator.
The overriden user agent in step 1 should start reflecting.
Answered By - Anurag Kalia
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.