Thursday, December 26, 2024

Person-Agent Discount on Android WebView


Person-Agent Discount on Android WebView

Posted by Mike Taylor (Privateness Sandbox), and Mihai Cîrlănaru (Internet on Android)

The Person-Agent string has been decreased in Chrome on Desktop and Chrome on Android platforms since Chrome 107. Starting in Android 16, the default Person-Agent string in Android WebView might be equally decreased.

Up to date Person-Agent string

The default, decreased WebView Person-Agent string is as follows:

Mozilla/5.0 (Linux; Android 10; Ok; wv) AppleWebKit/537.36 (KHTML, like Gecko) Model/4.0 Chrome/125.000 Cell Safari/537.36

A diagram illustrating how different parts of a user agent string are updated.

As seen within the diagram, the OS, CPU, and Construct data might be decreased to the static “Linux; Android 10; Ok” string. Minor/construct/patch model data can also be decreased to “0.0.0” The remainder of the default Person-Agent stays unchanged (and is unchanging).

How can I detect WebView by way of the Person-Agent string?

Websites can proceed to search for the wv token within the Person-Agent string, except an software has determined to override the Person-Agent string.

Does WebView assist Person-Agent Consumer Hints?

Android WebView has supported Person-Agent Consumer Hints since model 116, however just for functions that ship the default Person-Agent string.

Will a customized WebView Person-Agent string be affected?

The flexibility to set a customized Person-Agent by way of setUserAgentString() received’t be affected – and functions that select to take action received’t ship the decreased Person-Agent string.


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles