You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed bug versions::load() where if the cache folder already existed by the cache file didn't, the cache file wasn't written.
Changed default setting to not specify where the versions cache file is stored, thus version information will not be retrieved unless it is explicitly set.
Updated `versions::get()` to handle when the cache file has not been specified.
Fixed issue in `versions::get()` where the `currentdate` parameter was not passed to `versions::latest()`.
Flattened version settings so they are not in their own sub array.
Added `agentzero::getHints()` to retrieve the client hints sent by the browser.
Updated `README.md` with information on how to parse client hints and add versioning information.
Copy file name to clipboardExpand all lines: README.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,8 +60,8 @@ The returned value will be something like:
60
60
public readonly ?string 'browser' => string 'Chrome';
61
61
public readonly ?string 'browserversion' => string '116.0.0.0';
62
62
public readonly ?string 'browserstatus' => 'previous';
63
-
public readonly ?string 'browserreleased' => '2023-09-15';
64
-
public readonly ?string 'browserlatest' => '133.0.6943.54';
63
+
public readonly ?string 'browserreleased' => '2023-09-15';
64
+
public readonly ?string 'browserlatest' => '133.0.6943.54';
65
65
public readonly ?string 'language' => string 'en-GB';
66
66
67
67
// app
@@ -87,6 +87,43 @@ The returned value will be something like:
87
87
88
88
You can read the [full list of properties here](docs/api.md).
89
89
90
+
### Client Hints
91
+
92
+
AgentZero now supports processing client hints for improved user-agent information. You must request the client hints to improve the information delivered through the user-agent string:
Note that by using the `Accept-CH` header, you may receive client hints on subsequent requests, if you need the client hints on first call, use the `Critical-CH` header instead.
107
+
108
+
### Browser Versions
109
+
110
+
You can determine the date the browser was released, latest version, and status, by setting where the version file should be cached:
$ua->browserstatus, // either "canary", "beta", "latest", "previous", "legacy", legacy means released over 5 years ago
119
+
$ua->browserreleased, // the date the browser was released
120
+
$us->browserlatest // the latest version number of the browser
121
+
);
122
+
123
+
```
124
+
125
+
The browser version information is sourced from [my browser versions project](https://github.com/hexydec/versions).
126
+
90
127
## Supported Features
91
128
92
129
AgentZero supports a wide range of architectures, browsers, rendering engines, platforms, devices, languages, and crawlers. [Access the full list on the Supported Features page](docs/support.md).
* Determines the latest version of a browser, optionally capped by the supplied date
56
+
*
57
+
* @param array<string,string> $versions An array of browser versions, where the key is the version number and the value is the release date (In Ymd format)
0 commit comments