mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-31 19:41:33 +02:00
feat: add CountEntries to skip decryption for list --detail (#562)
* feat: add CountEntries to skip decryption for list --detail (#549) * test: add CountEntries and countCategory tests at browser level * fix: address review feedback on CountRows and countLocalStorage * test: add CountRows unit tests
This commit is contained in:
@@ -34,3 +34,18 @@ func extractExtensions(path string) ([]types.ExtensionEntry, error) {
|
||||
|
||||
return extensions, nil
|
||||
}
|
||||
|
||||
func countExtensions(path string) (int, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
var count int
|
||||
for _, v := range gjson.GetBytes(data, "addons").Array() {
|
||||
if v.Get("location").String() == "app-profile" {
|
||||
count++
|
||||
}
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user