client.browser.version

STRING, read-only.

Available inall subroutines.

The version of the browser in use on client device. This applies to browsers on all client devices, not just those for which client.class.browser is true.

Example

An example of applying a Feature-Policy based on the major part of a particular browser's version number:

declare local var.browser_version INTEGER;
if (client.browser.name != "" && client.browser.version != "") {
# capture just the major version
set var.browser_version = std.atoi(if (client.browser.version ~ "^([0-9]+)", re.group.1, "0"));
# A vulnerability in WebUSB in Chrome was fixed in v73,
# so disable USB in any version earlier than that
if (client.browser.name == "Chrome" && var.browser_version < 73) {
add resp.http.Feature-Policy = "usb 'none'";
}
}

User contributed notes

BETA

Do you see an error in this page? Do you have an interesting use case, example or edge case people should know about? Share your knowledge and help people who are reading this page! (Comments are moderated; for support, please contact Fastly support)