Skip to main content

A tool to import chrome search engines (keywords).

Project description

Chrome Search Engine Importer

Custom Search Engines in chrome can make searching for things in private/internal systems a lot more efficient and easier, so long as those systems allow you to input the search string in the URI.

Custom Search Engines can also function as keyword shortcuts to URLs, if you don't wish to fumble around with your bookmarks and would rather type in a keyword in the search bar + to take you to where you are trying to go.

However, when you collaborate with other people who often use the same systems that you do, it can be helpful to share these custom search gines with one another. The manual method for adding custom search engines does not scale well when you need to share a lot of them. Thus, the need for this script to make that manual process easier and the framework of defining custom search engine keywords as YAML files.

How does it work?

Defining search engine keywords in YAML

You will need to create a YML file with your hsortcuts like the example below. The example file, example_search_engines.yml also has some practical examples.

- name: Shortcut 1 Name
  keyword: shorcut1keyword
  url: https://shortcut1/url?q={searchTerms}
- name: Shortcut 2 Name
  keyword: shortcut2keyword
  url: https://shortcut2url.com/search/%s
- name: Virustotal UI
  keyword: vtui
  url: https://www.virustotal.com

NOTE: %s and {searchTerms} are synonymous. All occurrences of %s in the URL are replaced with {searchTerms} when being added to the database.

Using the script

Once you have defined your shortcuts, you may use the script, you must pass the path to the YML file to it. Example:

python3 chrome-search-engine-importer.py -e example_search_engines.yml

By default, the script will look in the default paths for Chrome profiles (on MacOS, Windows, and Linux). You will be given the option to choose which profiles found in the default paths to load the keyhwords in.

To bypass this, you may optionally use the -p flag to specify a path to a profile that is not in a default path.
NOTE: The path should point to the directory that has the sqlite database file Web Data inside of it.

> python3 chrome-search-engine-importer.py --help
Usage: chrome-search-engine-importer.py [OPTIONS]

Options:
  -e, --search-engines-file TEXT  Path to a YAML file with search engines
                                  defined  [required]
  -p, --profile TEXT              Path to a chrome profile. Useful if a target
                                  chrome profile is in a custom path.
  --help                          Show this message and exit.

The script will install any keywords in the YAML that do not already exist in the Web Data database. If you want to add these to be added, either adjust modify the keyword so that it is unique, or delete the existing keyword from your chrome search engines here.

You have to restart chrome

On Windows, Chrome needs to be closed while the script runs otherwise you will encounter an error when the script tries to swap out the Web Data sqlite database.

For the newly added keywords to be visible in chrome, you must relaunch Chrome so that it reloads the SQLite database. I recommend enabling the "Continue where you left off" Startup Option in Chrome so that your tabs recover after you restart the browser.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chrome-search-engine-importer-0.1.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chrome_search_engine_importer-0.1.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file chrome-search-engine-importer-0.1.2.tar.gz.

File metadata

File hashes

Hashes for chrome-search-engine-importer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1f9a235c04701dadf0b92fb8f8be08e054d32eefb77d4df66762ac7a5d2e6bfd
MD5 b1ea814047cc2ea3ffebfe38da3adad3
BLAKE2b-256 327700fcc9c5bd715a304963459a29e07739df8956fb4461c62ca1ba1b47f713

See more details on using hashes here.

File details

Details for the file chrome_search_engine_importer-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for chrome_search_engine_importer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 443d0ee589bb0b96fc9ecd432dd60ccb86c41a00f54122b0ed4ffccbb49661f5
MD5 4081c023c044d3c752a5c586f27586ae
BLAKE2b-256 907bc6aeb9fda025dea43e4553f3465c71a32fcc4b09e3679e752492471e642f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page