mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-11 17:14:38 +02:00
support XDG standard, search for chrome and chromium DBs
This commit is contained in:
@@ -43,9 +43,21 @@ find_firefox_places_db() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_chrome_history_db() {
|
find_chrome_history_db() {
|
||||||
if is_linux; then
|
if is_linux; then
|
||||||
echo ~/.config/chromium/Default/History
|
local config_home="${XDG_CONFIG_HOME:-${HOME}/.config}"
|
||||||
|
for path in \
|
||||||
|
"${config_home}/chromium/Default/History" \
|
||||||
|
"${config_home}/google-chrome/Default/History";
|
||||||
|
do
|
||||||
|
if [ -f "${path}" ]; then
|
||||||
|
echo "${path}"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Unable to find Chrome history database. You can supply it manually as a second parameter." >&2
|
||||||
|
exit 1
|
||||||
else
|
else
|
||||||
echo ~/Library/Application\ Support/Google/Chrome/Default/History
|
echo ~/Library/Application\ Support/Google/Chrome/Default/History
|
||||||
fi
|
fi
|
||||||
@@ -55,7 +67,7 @@ export_chrome() {
|
|||||||
if [[ -e "$2" ]]; then
|
if [[ -e "$2" ]]; then
|
||||||
cp "$2" "$OUTPUT_DIR/chrome_history.db.tmp"
|
cp "$2" "$OUTPUT_DIR/chrome_history.db.tmp"
|
||||||
else
|
else
|
||||||
default="$(get_chrome_history_db)"
|
default="$(find_chrome_history_db)"
|
||||||
echo "Defaulting to history db: $default"
|
echo "Defaulting to history db: $default"
|
||||||
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
echo "Optionally specify the path to a different sqlite history database as the 2nd argument."
|
||||||
cp "$default" "$OUTPUT_DIR/chrome_history.db.tmp"
|
cp "$default" "$OUTPUT_DIR/chrome_history.db.tmp"
|
||||||
|
Reference in New Issue
Block a user