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

Commit

Permalink
Add PhantomJS (#98)
Browse files Browse the repository at this point in the history
fixes #81

Signed-off-by: Kayabe <lorenzoanonim@yahoo.com>
  • Loading branch information
kayabe committed Feb 8, 2023
1 parent 966720f commit 6b5e6f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions all_test.go
Expand Up @@ -476,6 +476,11 @@ var uastrings = []struct {
ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4515.107 Safari/537.36",
expected: "Mozilla:5.0 Platform:X11 OS:Linux x86_64 Browser:Headless Chrome-92.0.4515.107 Engine:AppleWebKit-537.36 Bot:false Mobile:false",
},
{
title: "PhantomJS",
ua: "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1",
expected: "Mozilla:5.0 Platform:Unknown OS:Linux x86_64 Browser:PhantomJS-2.1.1 Engine:AppleWebKit-538.1 Bot:false Mobile:false",
},
{
title: "SafariMac",
ua: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16",
Expand Down
3 changes: 3 additions & 0 deletions browser.go
Expand Up @@ -101,6 +101,9 @@ func (p *UserAgent) detectBrowser(sections []section) {
case "DuckDuckGo":
p.browser.Name = "DuckDuckGo"
p.browser.Version = sections[slen-2].version
case "PhantomJS":
p.browser.Name = "PhantomJS"
p.browser.Version = sections[slen-2].version
default:
switch sections[sectionIndex].name {
case "Chrome", "CriOS":
Expand Down

0 comments on commit 6b5e6f6

Please sign in to comment.