This repository was archived by the owner on Apr 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +45
-4
lines changed
Expand file tree Collapse file tree 2 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 357357 'Avant Browser' ,
358358 'Breach' ,
359359 'Camino' ,
360+ 'Electron' ,
360361 'Epiphany' ,
361362 'Fennec' ,
362363 'Flock' ,
680681 name = / [ a - z ] + (?: H a t ) ? / i. exec ( / \b A n d r o i d \b / . test ( os ) ? os : data ) + ' Browser' ;
681682 }
682683 }
684+ // Add Chrome version to description for Electron.
685+ else if ( name == 'Electron' && ( data = ( / \b C h r o m e \/ ( [ \d . ] + ) \b / . exec ( ua ) || 0 ) [ 1 ] ) ) {
686+ description . push ( 'Chromium ' + data ) ;
687+ }
683688 // Detect non-Opera (Presto-based) versions (order is important).
684689 if ( ! version ) {
685690 version = getVersion ( [
746751 typeof context . process == 'object' && ! context . process . browser &&
747752 ( data = context . process )
748753 ) {
749- name = 'Node.js' ;
750- arch = data . arch ;
751- os = data . platform ;
752- version = / [ \d . ] + / . exec ( data . version ) [ 0 ] ;
754+ if ( typeof data . versions == 'object' ) {
755+ if ( typeof data . versions . electron == 'string' ) {
756+ description . push ( 'Node ' + data . versions . node ) ;
757+ name = 'Electron' ;
758+ version = data . versions . electron ;
759+ } else if ( typeof data . versions . nw == 'string' ) {
760+ description . push ( 'Chromium ' + version , 'Node ' + data . versions . node ) ;
761+ name = 'NW.js' ;
762+ version = data . versions . nw ;
763+ }
764+ } else {
765+ name = 'Node.js' ;
766+ arch = data . arch ;
767+ os = data . platform ;
768+ version = / [ \d . ] + / . exec ( data . version ) [ 0 ] ;
769+ }
753770 }
754771 else if ( rhino ) {
755772 name = 'Rhino' ;
Original file line number Diff line number Diff line change 628628 'os' : 'iOS 4.3+'
629629 } ,
630630
631+ 'Electron 1.4.5 (Chromium 53.0.2785.113; Node 6.5.0) on Windows 10 64-bit' : {
632+ 'ua' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) electron-app/1.0.0 Chrome/53.0.2785.113 Electron/1.4.5 Safari/537.36' ,
633+ 'global' : { } ,
634+ 'layout' : 'Blink' ,
635+ 'name' : 'Electron' ,
636+ 'os' : 'Windows 10 64-bit' ,
637+ 'process' : {
638+ 'versions' : { 'electron' : '1.4.5' , 'node' : '6.5.0' }
639+ } ,
640+ 'version' : '1.4.5'
641+ } ,
642+
631643 'Epiphany 0.9.2 on Linux i686' : {
632644 'ua' : 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030908 Epiphany/0.9.2' ,
633645 'layout' : 'Gecko' ,
17371749 'version' : '1.0'
17381750 } ,
17391751
1752+ 'NW.js 0.18.4 (Chromium 54.0.2840.71; Node 7.0.0) on Windows 10 64-bit' : {
1753+ 'ua' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36' ,
1754+ 'global' : { } ,
1755+ 'layout' : 'Blink' ,
1756+ 'name' : 'NW.js' ,
1757+ 'os' : 'Windows 10 64-bit' ,
1758+ 'process' : {
1759+ 'versions' : { 'nw' : '0.18.4' , 'node' : '7.0.0' }
1760+ } ,
1761+ 'version' : '0.18.4'
1762+ } ,
1763+
17401764 'Opera 9.00 on Nintendo Wii' : {
17411765 'ua' : 'Opera/9.00 (Nintendo Wii; U; ; 1309-9; en)' ,
17421766 'layout' : 'Presto' ,
You can’t perform that action at this time.
0 commit comments