This repository was archived by the owner on Feb 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,11 @@ var uastrings = []struct {
541
541
ua : "Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4" ,
542
542
expected : "Mozilla:5.0 Platform:iPhone OS:CPU iPhone OS 8_3 like Mac OS X Browser:Firefox-1.0 Engine:AppleWebKit-600.1.4 Bot:false Mobile:true" ,
543
543
},
544
+ {
545
+ title : "Electron" ,
546
+ ua : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) CozyDrive/3.17.0 Chrome/73.0.3683.119 Electron/5.0.0 Safari/537.36" ,
547
+ expected : "Mozilla:5.0 Platform:Windows OS:Windows 10 Browser:Electron-5.0.0 Engine:AppleWebKit-537.36 Bot:false Mobile:false" ,
548
+ },
544
549
545
550
// Dalvik
546
551
{
Original file line number Diff line number Diff line change @@ -74,15 +74,21 @@ func (p *UserAgent) detectBrowser(sections []section) {
74
74
p .browser .Name = "YaBrowser"
75
75
p .browser .Version = sections [slen - 3 ].version
76
76
default :
77
- switch sections [sectionIndex ].name {
78
- case "Chrome" , "CriOS" :
79
- p .browser .Name = "Chrome"
80
- case "Chromium" :
81
- p .browser .Name = "Chromium"
82
- case "FxiOS" :
83
- p .browser .Name = "Firefox"
77
+ switch sections [slen - 2 ].name {
78
+ case "Electron" :
79
+ p .browser .Name = "Electron"
80
+ p .browser .Version = sections [slen - 2 ].version
84
81
default :
85
- p .browser .Name = "Safari"
82
+ switch sections [sectionIndex ].name {
83
+ case "Chrome" , "CriOS" :
84
+ p .browser .Name = "Chrome"
85
+ case "Chromium" :
86
+ p .browser .Name = "Chromium"
87
+ case "FxiOS" :
88
+ p .browser .Name = "Firefox"
89
+ default :
90
+ p .browser .Name = "Safari"
91
+ }
86
92
}
87
93
}
88
94
// It's possible the google-bot emulates these now
You can’t perform that action at this time.
0 commit comments