33package browser
44
55import (
6- "io/ioutil"
7- "os"
8-
96 "hack-browser-data/internal/item"
107)
118
1815 }{
1916 "chrome" : {
2017 name : chromeName ,
21- profilePath : getProfiles ( chromeUserDataPath )[ 0 ] ,
18+ profilePath : chromeUserDataPath ,
2219 items : item .DefaultChromium ,
2320 },
2421 "edge" : {
@@ -28,12 +25,12 @@ var (
2825 },
2926 "chromium" : {
3027 name : chromiumName ,
31- profilePath : getProfiles ( chromiumUserDataPath )[ 0 ] ,
28+ profilePath : chromiumUserDataPath ,
3229 items : item .DefaultChromium ,
3330 },
3431 "chrome-beta" : {
3532 name : chromeBetaName ,
36- profilePath : getProfiles ( chromeBetaUserDataPath )[ 0 ] ,
33+ profilePath : chromeBetaUserDataPath ,
3734 items : item .DefaultChromium ,
3835 },
3936 "opera" : {
@@ -91,31 +88,10 @@ var (
9188 }
9289)
9390
94- func getProfiles (userDataPath string ) []string {
95- var res []string
96- files , err := ioutil .ReadDir (userDataPath )
97-
98- if err != nil {
99-
100- res = append (res , userDataPath + "Default" )
101- }
102-
103- for _ , f := range files {
104- if f .IsDir () && f .Name () != "System Profile" {
105- var thisPath = userDataPath + f .Name ()
106- _ , err := os .Stat (thisPath + "/Login Data" )
107- if err == nil {
108- res = append (res , userDataPath + f .Name ())
109- }
110- }
111- }
112- return res
113- }
114-
11591var (
116- chromeUserDataPath = homeDir + "/AppData/Local/Google/Chrome/User Data/"
117- chromeBetaUserDataPath = homeDir + "/AppData/Local/Google/Chrome Beta/User Data/"
118- chromiumUserDataPath = homeDir + "/AppData/Local/Chromium/User Data/"
92+ chromeUserDataPath = homeDir + "/AppData/Local/Google/Chrome/User Data/Default/ "
93+ chromeBetaUserDataPath = homeDir + "/AppData/Local/Google/Chrome Beta/User Data/Default/ "
94+ chromiumUserDataPath = homeDir + "/AppData/Local/Chromium/User Data/Default/ "
11995 edgeProfilePath = homeDir + "/AppData/Local/Microsoft/Edge/User Data/Default/"
12096 braveProfilePath = homeDir + "/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/"
12197 speed360ProfilePath = homeDir + "/AppData/Local/360chrome/Chrome/User Data/Default/"
0 commit comments