Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f99ff3d

Browse files
committed
[cookie.chrome] add linux support.
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent 4b86c40 commit f99ff3d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

plugins/cookie.chrome.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ var session = require('../session');
88
//
99
var 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

1319
var Chrome = {};
1420

@@ -21,11 +27,15 @@ var ChromeMAC = {
2127
}
2228
};
2329

24-
// TODO: test this
2530
var 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

3141
var ChromeWindows = {

0 commit comments

Comments
 (0)