1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Merge pull request #375 from Farfurix/add-electron

Add Electron support
This commit is contained in:
Denis Demchenko 2019-12-26 15:46:23 +02:00 committed by GitHub
commit 9ecf3e94c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 0 deletions

View File

@ -7,6 +7,7 @@ export const BROWSER_ALIASES_MAP = {
BlackBerry: 'blackberry', BlackBerry: 'blackberry',
Chrome: 'chrome', Chrome: 'chrome',
Chromium: 'chromium', Chromium: 'chromium',
Electron: 'electron',
Epiphany: 'epiphany', Epiphany: 'epiphany',
Firefox: 'firefox', Firefox: 'firefox',
Focus: 'focus', Focus: 'focus',
@ -48,6 +49,7 @@ export const BROWSER_MAP = {
blackberry: 'BlackBerry', blackberry: 'BlackBerry',
chrome: 'Chrome', chrome: 'Chrome',
chromium: 'Chromium', chromium: 'Chromium',
electron: 'Electron',
epiphany: 'Epiphany', epiphany: 'Epiphany',
firefox: 'Firefox', firefox: 'Firefox',
focus: 'Focus', focus: 'Focus',

View File

@ -531,6 +531,21 @@ const browsersList = [
return browser; return browser;
}, },
}, },
{
test: [/electron/i],
describe(ua) {
const browser = {
name: 'Electron',
};
const version = Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i, ua);
if (version) {
browser.version = version;
}
return browser;
},
},
{ {
test: [/chromium/i], test: [/chromium/i],
describe(ua) { describe(ua) {

View File

@ -2908,3 +2908,59 @@
engine: engine:
name: "WebKit" name: "WebKit"
version: "605.1.15" version: "605.1.15"
Electron:
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) my-app/1.0.0 Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.146 Electron/6.1.5 Safari/537.36"
spec:
browser:
name: "Electron"
version: "6.1.5"
os:
name: "Windows"
version: "NT 10.0"
versionName: "10"
platform:
type: "desktop"
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "macOS"
version: "10.15.1"
versionName: "Catalina"
platform:
type: "desktop"
vendor: 'Apple'
engine:
name: "Blink"
-
ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.113 Electron/7.1.2 Safari/537.36"
spec:
browser:
name: "Electron"
version: "7.1.2"
os:
name: "Linux"
platform:
type: "desktop"
engine:
name: "Blink"