File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,13 @@ var session = require('../session');
88//
99var plugin = new Plugin ( 13 , 'cookie.chrome' , '2017.12.23' ,
1010 'Plugin to reuse Chrome\'s leetcode cookie.' ,
11- [ 'keytar' , 'sqlite3' ] ) ;
11+ [ 'keytar:darwin' , 'sqlite3' ] ) ;
12+
13+ plugin . help = function ( ) {
14+ if ( os . platform === 'linux' ) {
15+ log . info ( 'To complete the install: sudo apt install libsecret-tools' ) ;
16+ }
17+ } ;
1218
1319var Chrome = { } ;
1420
@@ -21,11 +27,15 @@ var ChromeMAC = {
2127 }
2228} ;
2329
24- // TODO: test this
2530var ChromeLinux = {
2631 db : process . env . HOME + '/.config/google-chrome/Default/Cookies' ,
2732 iterations : 1 ,
28- getPassword : function ( cb ) { cb ( 'peanuts' ) ; }
33+ getPassword : function ( cb ) {
34+ // FIXME: keytar failed to read gnome-keyring on ubuntu??
35+ var cmd = 'secret-tool lookup application chrome' ;
36+ var password = require ( 'child_process' ) . execSync ( cmd ) . toString ( ) ;
37+ return cb ( password ) ;
38+ }
2939} ;
3040
3141var ChromeWindows = {
You can’t perform that action at this time.
0 commit comments