• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/web/useragent/detector.php
  • Класс: BitrixMainWebUserAgentDetector
  • Вызов: Detector::detectBrowser
public function detectBrowser(?string $userAgent): Browser
{
	$browser = $this->getKnownAgent($userAgent);

	if ($browser === null)
	{
		$info = get_browser($userAgent);

		$deviceType = $this->getDeviceType($info);

		$browser = new Browser($info->browser, $info->platform, $deviceType);
	}

	$browser->setUserAgent($userAgent);

	return $browser;
}