@mherod/get-cookie 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +25 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29,6 +29,10 @@ async function getChromePassword() {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
async function getCookie() {
|
|
33
|
+
throw new Error('Not implemented');
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
/**
|
|
33
37
|
*
|
|
34
38
|
* @param name
|
|
@@ -271,7 +275,9 @@ function printStringValue(r) {
|
|
|
271
275
|
// noinspection JSUnusedGlobalSymbols
|
|
272
276
|
module.exports = {
|
|
273
277
|
getDecryptedCookie: getChromeCookie,
|
|
274
|
-
getChromeCookie
|
|
278
|
+
getChromeCookie,
|
|
279
|
+
getFirefoxCookie,
|
|
280
|
+
getCookie
|
|
275
281
|
};
|
|
276
282
|
|
|
277
283
|
if (process.argv) {
|
|
@@ -292,12 +298,22 @@ if (process.argv) {
|
|
|
292
298
|
process.env.IGNORE_EXPIRED = "true";
|
|
293
299
|
}
|
|
294
300
|
|
|
301
|
+
if (process.env.VERBOSE) {
|
|
302
|
+
console.log("Verbose mode", process.argv);
|
|
303
|
+
}
|
|
304
|
+
|
|
295
305
|
if (process.env.CHROME_ONLY) {
|
|
296
306
|
if (process.env.VERBOSE) {
|
|
297
307
|
console.log('chrome only');
|
|
298
308
|
}
|
|
299
309
|
getChromeCookie({name, domain})
|
|
300
|
-
.then(
|
|
310
|
+
.then(cookie => {
|
|
311
|
+
if (cookie && cookie.length > 0) {
|
|
312
|
+
printStringValue(cookie);
|
|
313
|
+
} else {
|
|
314
|
+
console.log('No cookie found');
|
|
315
|
+
}
|
|
316
|
+
})
|
|
301
317
|
.catch(err => {
|
|
302
318
|
if (process.env.VERBOSE) {
|
|
303
319
|
console.error(err);
|
|
@@ -308,7 +324,13 @@ if (process.argv) {
|
|
|
308
324
|
console.log('firefox only');
|
|
309
325
|
}
|
|
310
326
|
getFirefoxCookie({name, domain})
|
|
311
|
-
.then(
|
|
327
|
+
.then(cookie => {
|
|
328
|
+
if (cookie && cookie.length > 0) {
|
|
329
|
+
printStringValue(cookie);
|
|
330
|
+
} else {
|
|
331
|
+
console.log('No cookie found');
|
|
332
|
+
}
|
|
333
|
+
})
|
|
312
334
|
.catch(err => {
|
|
313
335
|
if (process.env.VERBOSE) {
|
|
314
336
|
console.error("Error getting Firefox cookie", err);
|