} /* Derive the default browser on BlackBerry */ if ($this->data->os->name == 'BlackBerry' && !isset($this->data->browser->name) && $this->data->browser->stock) { $this->data->browser->name = 'BlackBerry Browser'; $this->data->browser->hidden = true; } if ($this->data->os->name == 'BlackBerry OS' && !isset($this->data->browser->name) && $this->data->browser->stock) { $this->data->browser->name = 'BlackBerry Browser'; $this->data->browser->hidden = true; } if ($this->data->os->name == 'BlackBerry Tablet OS' && !isset($this->data->browser->name) && $this->data->browser->stock) { $this->data->browser->name = 'BlackBerry Browser'; $this->data->browser->hidden = true; } /* Derive the default browser on Tizen */ if ($this->data->os->name == 'Tizen' && !isset($this->data->browser->name) && $this->data->browser->stock && in_array($this->data->device->type, [ Constants\DeviceType::MOBILE, Constants\DeviceType::APPLIANCE ])) { $this->data->browser->name = 'Samsung Browser'; } /* Derive the default browser on Aliyun OS */ if ($this->data->os->name == 'Aliyun OS' && !isset($this->data->browser->using) && !isset($this->data->browser->name) && $this->data->browser->stock) { $this->data->browser->name = 'Aliyun Browser'; } if ($this->data->os->name == 'Aliyun OS' && $this->data->browser->isUsing('Chrome Content Shell')) { $this->data->browser->name = 'Aliyun Browser'; $this->data->browser->using = null; $this->data->browser->stock = true; } if ($this->data->os->name == 'Aliyun OS' && $this->data->browser->stock) { $this->data->browser->hidden = true; } /* Derive OS/2 nickname */ if ($this->data->os->name == 'OS/2') { if (!empty($this->data->os->version)) { if ($this->data->os->version->is('>', '2')) { $this->data->os->version->nickname = 'Warp'; } } } /* Derive HP TouchPad based on webOS and tablet */ if ($this->data->os->name == 'webOS' && $this->data->device->type == Constants\DeviceType::TABLET) { $this->data->device->manufacturer = 'HP'; $this->data->device->model = 'TouchPad'; $this->data->device->identified |= Constants\Id::MATCH_UA; } /* Derive Windows 10 Mobile edition */ if ($this->data->os->name == 'Windows Phone') { if (!empty($this->data->os->version)) { if ($this->data->os->version->is('=', '10')) { $this->data->os->alias = 'Windows'; $this->data->os->edition = 'Mobile'; $this->data->os->version->alias = '10'; } } } /* Derive manufacturer and model based on MacOS or OS X */ if ($this->data->os->name == 'OS X' || $this->data->os->name == 'Mac OS') { if (empty($this->data->device->model)) { $this->data->device->manufacturer = 'Apple'; $this->data->device->model = 'Macintosh'; $this->data->device->identified |= Constants\Id::INFER; $this->data->device->hidden = true; } } /* Derive manufacturer and model based on MacOS or OS X */ if ($this->data->os->name == 'iOS') { if (empty($this->data->device->model)) { $this->data->device->manufacturer = 'Apple'; $this->data->device->identified |= Constants\Id::INFER; $this->data->device->hidden = true; } } /* Derive iOS and OS X aliases */ if ($this->data->os->name == 'iOS') { if (!empty($this->data->os->version)) { if ($this->data->os->version->is('<', '4')) { $this->data->os->alias = 'iPhone OS'; } } } if ($this->data->os->name == 'OS X') { if (!empty($this->data->os->version)) { if ($this->data->os->version->is('<', '10.7')) { $this->data->os->alias = 'Mac OS X'; } if ($this->data->os->version->is('>=', '10.12')) { $this->data->os->alias = 'macOS'; } if ($this->data->os->version->is('10.7')) { $this->data->os->version->nickname = 'Lion'; } if ($this->data->os->version->is('10.8')) { $this->data->os->version->nickname = 'Mountain Lion'; } if ($this->data->os->version->is('10.9')) { $this->data->os->version->nickname = 'Mavericks'; } if ($this->data->os->version->is('10.10')) { $this->data->os->version->nickname = 'Yosemite'; } if ($this->data->os->version->is('10.11')) { $this->data->os->version->nickname = 'El Capitan'; } if ($this->data->os->version->is('10.12')) { $this->data->os->version->nickname = 'Sierra'; } if ($this->data->os->version->is('10.13')) { $this->data->os->version->nickname = 'High Sierra'; } if ($this->data->os->version->is('10.14')) { $this->data->os->version->nickname = 'Mojave'; } if ($this->data->os->version->is('10.15')) { $this->data->os->version->nickname = 'Catalina'; } if ($this->data->os->version->is('11')) { $this->data->os->version->nickname = 'Big Sur'; } if ($this->data->os->version->is('12')) { $this->data->os->version->nickname = 'Monterey'; } } } } }