user_agent icon indicating copy to clipboard operation
user_agent copied to clipboard

PhantomJS user agent

Open thompiler opened this issue 2 years ago • 0 comments

Description

The user agent name for PhantomJS is being reported as Safari when it probably should be PhantomJS.

Steps to reproduce

Get name value of PhantomJS user agent: Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1

  • Expected behavior: user agent name is PhantomJS
  • Actual behavior: user agent name is Safari

user_agent version

0.5.3

Go version and interpreter

1.16.6

Code example

package main

import (
	"fmt"

	"github.com/mssola/user_agent"
)

func main() {
	ua := user_agent.New(
		"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1")

	name, _ := ua.Browser()
	fmt.Printf("%v\n", name) // This should be "PhantomJS" instead of "Safari"
}

Golang playground example: https://play.golang.org/p/2cXcLn1Kzi3

thompiler avatar Jul 19 '21 19:07 thompiler