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

Commit 6b5e6f6

Browse files
authored
Add PhantomJS (#98)
fixes #81 Signed-off-by: Kayabe <lorenzoanonim@yahoo.com>
1 parent 966720f commit 6b5e6f6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

all_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,11 @@ var uastrings = []struct {
476476
ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/92.0.4515.107 Safari/537.36",
477477
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",
478478
},
479+
{
480+
title: "PhantomJS",
481+
ua: "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1",
482+
expected: "Mozilla:5.0 Platform:Unknown OS:Linux x86_64 Browser:PhantomJS-2.1.1 Engine:AppleWebKit-538.1 Bot:false Mobile:false",
483+
},
479484
{
480485
title: "SafariMac",
481486
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",

browser.go

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ func (p *UserAgent) detectBrowser(sections []section) {
101101
case "DuckDuckGo":
102102
p.browser.Name = "DuckDuckGo"
103103
p.browser.Version = sections[slen-2].version
104+
case "PhantomJS":
105+
p.browser.Name = "PhantomJS"
106+
p.browser.Version = sections[slen-2].version
104107
default:
105108
switch sections[sectionIndex].name {
106109
case "Chrome", "CriOS":

0 commit comments

Comments
 (0)