File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,14 @@ Chrome.getCookies = function(cb) {
134134 db . on ( 'error' , cb ) ;
135135 var KEYS = [ 'csrftoken' , 'LEETCODE_SESSION' ] ;
136136
137+ let host = config . sys . cookie_host ;
138+ if ( ! host ) {
139+ host = 'leetcode.com' ; // default host key
140+ }
141+
137142 db . serialize ( function ( ) {
138143 var cookies = { } ;
139- var sql = 'select name, encrypted_value from cookies where host_key like "%leetcode.com "' ;
144+ var sql = 'select name, encrypted_value from cookies where host_key like "%' + host + ' "';
140145 db . each ( sql , function ( e , x ) {
141146 if ( e ) return cb ( e ) ;
142147 if ( KEYS . indexOf ( x . name ) < 0 ) return ;
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ plugin.init = function() {
3131 config . sys . urls . verify = 'https://leetcode-cn.com/submissions/detail/$id/check/' ;
3232 config . sys . urls . favorites = 'https://leetcode-cn.com/list/api/questions' ;
3333 config . sys . urls . favorite_delete = 'https://leetcode-cn.com/list/api/questions/$hash/$id' ;
34+ config . sys . cookie_host = 'leetcode-cn.com' ;
3435} ;
3536
3637// FIXME: refactor those
You can’t perform that action at this time.
0 commit comments