mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-06 21:37:47 +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:
@@ -8,8 +8,11 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const firefoxHistoryQuery = `SELECT url, COALESCE(last_visit_date, 0),
|
||||
COALESCE(title, ''), visit_count FROM moz_places`
|
||||
const (
|
||||
firefoxHistoryQuery = `SELECT url, COALESCE(last_visit_date, 0),
|
||||
COALESCE(title, ''), visit_count FROM moz_places`
|
||||
firefoxCountHistoryQuery = `SELECT COUNT(*) FROM moz_places`
|
||||
)
|
||||
|
||||
func extractHistories(path string) ([]types.HistoryEntry, error) {
|
||||
histories, err := sqliteutil.QueryRows(path, true, firefoxHistoryQuery,
|
||||
@@ -36,3 +39,7 @@ func extractHistories(path string) ([]types.HistoryEntry, error) {
|
||||
})
|
||||
return histories, nil
|
||||
}
|
||||
|
||||
func countHistories(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, true, firefoxCountHistoryQuery)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user