Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #98 from jonasschumacher/feature/chromium-edge
Browse files Browse the repository at this point in the history
Add check for Chromium based Edge, resolves #94
  • Loading branch information
asdfklgash authored Sep 23, 2021
2 parents 16cad9c + fba53a8 commit 4927f7c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BrowserDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@ public static function checkBrowserEdge()
}
self::$browser->setName(Browser::EDGE);

return true;
} elseif (stripos(self::$userAgentString, 'Edg') !== false) {
$version = explode('Edg/', self::$userAgentString);
if (isset($version[1])) {
self::$browser->setVersion(trim($version[1]));
}
self::$browser->setName(Browser::EDGE);

return true;
}

Expand Down
12 changes: 12 additions & 0 deletions tests/BrowserDetector/Tests/_files/UserAgentStrings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,5 +274,17 @@
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) wkhtmltopdf-amd64 Safari/534.34
</field>
</string>
<string>
<field name="browser">Edge</field>
<field name="version">80.0.361.40</field>
<field name="os">Windows</field>
<field name="os_version">10.0</field>
<field name="device">unknown</field>
<field name="device_version">unknown</field>
<field name="string">
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.66
Safari/537.36 Edg/80.0.361.40
</field>
</string>
</strings>
</document>

0 comments on commit 4927f7c

Please sign in to comment.