Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziru Zhu committed Dec 19, 2017
1 parent 057023c commit 812fb74
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Import/Export Google Chrome's custom search engines

**_Quit Google Chrome before exporting/importing custom search engines._**

To Export from one machine:
```
./export.sh
```

To Import on a different machine:
```
./import.sh
```

Note:
- The import script will drop all existent entries before inserting saved entries.
- This can be used to wipe search engines which are automatically added by many web sites.
Empty file added data/placeholder.txt
Empty file.
9 changes: 9 additions & 0 deletions export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

CHROME_DATA_PATH="${HOME}/Library/Application Support/Google/Chrome/Default"
SEARCH_ENGINE_DB="${CHROME_DATA_PATH}/Web Data"

OUTPUT_FILE=./data/keywords.sql

echo "[INFO] Backup existent keywords table into: ${OUTPUT_FILE}"
sqlite3 "${SEARCH_ENGINE_DB}" ".dump keywords" > ${OUTPUT_FILE}
12 changes: 12 additions & 0 deletions import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

CHROME_DATA_PATH="${HOME}/Library/Application Support/Google/Chrome/Default"
SEARCH_ENGINE_DB="${CHROME_DATA_PATH}/Web Data"

INPUT_FILE=./data/keywords.sql

echo "[INFO] Drop existent keywords table if any"
sqlite3 "${SEARCH_ENGINE_DB}" "DROP TABLE keywords"

echo "[INFO] Import custom search engine entries into Chrome Web Data database"
sqlite3 "${SEARCH_ENGINE_DB}" ".read ${INPUT_FILE}"

0 comments on commit 812fb74

Please sign in to comment.