@kazuma0129/chrome-cookies-secure
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -149,3 +149,3 @@ "use strict"; | ||
const parsedUrl = url_1.default.parse(uri); | ||
if (!parsedUrl.protocol || !parsedUrl.hostname) { | ||
if (!(parsedUrl.protocol && parsedUrl.hostname)) { | ||
return callback(new Error("Could not parse URI, format should be http://www.example.com/path/")); | ||
@@ -157,2 +157,3 @@ } | ||
} | ||
db.on("error", callback); | ||
getDerivedKey((err, derivedKey) => { | ||
@@ -169,3 +170,3 @@ if (err) { | ||
db.each(`SELECT host_key, path, is_secure, expires_utc, name, value, encrypted_value, creation_utc, is_httponly, has_expires, is_persistent FROM cookies where host_key like '%${domain}' ORDER BY LENGTH(path) DESC, creation_utc ASC`, (err, cookie) => { | ||
let encryptedValue, value; | ||
let encryptedValue; | ||
if (err) { | ||
@@ -211,17 +212,22 @@ return callback(err); | ||
switch (format) { | ||
case "curl": | ||
case "curl": { | ||
output = convertRawToNetscapeCookieFileFormat(validCookies, domain); | ||
break; | ||
case "jar": | ||
} | ||
case "jar": { | ||
output = convertRawToJar(validCookies, uri); | ||
break; | ||
case "set-cookie": | ||
} | ||
case "set-cookie": { | ||
output = convertRawToSetCookieStrings(validCookies); | ||
break; | ||
case "header": | ||
} | ||
case "header": { | ||
output = convertRawToHeader(validCookies); | ||
break; | ||
case "puppeteer": | ||
} | ||
case "puppeteer": { | ||
output = convertRawToPuppeteerState(validCookies); | ||
break; | ||
} | ||
case "object": | ||
@@ -228,0 +234,0 @@ default: |
{ | ||
"name": "@kazuma0129/chrome-cookies-secure", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Extract encrypted Google Chrome cookies for a url on a Mac or Linux", | ||
@@ -34,6 +34,6 @@ "keywords": [ | ||
"engines": { | ||
"node": "18.7.0" | ||
"node": ">=14" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.7.13", | ||
"@types/node": "^14.0.0", | ||
"ts-node": "^10.9.1", | ||
@@ -40,0 +40,0 @@ "ts-node-dev": "^2.0.0", |
Sorry, the diff of this file is not supported yet
26261
267