Skip to content

Instantly share code, notes, and snippets.

@guest271314
Last active January 12, 2025 00:06
Show Gist options
  • Save guest271314/a29fee9895ba5fdbd29ed69fb8076b30 to your computer and use it in GitHub Desktop.
Save guest271314/a29fee9895ba5fdbd29ed69fb8076b30 to your computer and use it in GitHub Desktop.
How to set a user-defined default search engine (and custom new tab page) in Chromium browser

In Chromium or Chrome browsers navigate to chrome://settings/searchEngines. The page looks something like this. Here I'm showing what Chromium Version 134.0.6949.0 (Developer Build) (64-bit). On Linux.

Screenshot_2025-01-11_14-45-55

Notice that ".(Default)".

That . is the default search engine I set. To default. No Google Search as default search engine. You can also notice I've deactivated the Gemini Search engine.

How did I do that?

See that "Site search" section, with the big 'ole "Add" button?

Click that and write out the search engine you to use - instead of the deafult Google Search engine.

Screenshot_2025-01-11_14-48-40

These are the fields in the UI when that "Add" ("Site search") button is clicked

Screenshot_2025-01-11_14-51-07

This is how I fill out the fields for my "." search engine.

Screenshot_2025-01-11_14-53-40

Then I set my "Site search" search engine to the Default search engine.

What is my "." search engine?

It's just a URL that sends search queries to the chrome://newtab page, which in my case is a Web extension page.

Screenshot_2025-01-11_14-58-07

It's just an HTML page. I don't do any search queries. When I type a non-URL in the Omnibox I just get redirected to my Web extension custom new tab page. As described in detail here Override Chrome pages

New Tab

The page that appears when the user creates a new tab or window. You can also get to this page by entering the URL chrome://newtab.

A simple manifest.json

{
  "name": "tab",
  "version": "1.0",
  "manifest_version": 3,
  "chrome_url_overrides": {
    "newtab": "./tab.html"
  }
}

A simple HTML file

<!doctype html>
<html>
<body style="height:calc(97.5vh);background:url(./darkest-in-the-world.png) no-repeat;background-size:cover;">
<video autoplay loop muted width="300" height="200" src="./liberian_girl.webm" style="position:fixed;top:calc(70vh);left:calc(70vw);"></video>
</body>
</html>

stored in a folder named tab.

Relevant part of the shell script I use to launch Chromium browser, either from the command line or native program launcher icon

#!/bin/sh
$HOME/chrome-linux/chrome \
--load-extension=/home/guest271314/tab

Screenshot_2025-01-11_15-54-18

An added side-effect of the above procedure is that also gets rid of the "Search with Lens" search box embedded in the right-side of the Omnibox. Nowadays there the "Customize Chromium" "Toolbox" where Google Lens search can also be disabled. I have encountered the removal of that box not working previously, so now, when I start up Chromium for the first time I do the process above so I don't even get that "Search with Lens" bubble once.

Now, when I type anything in the address bar (Omnibox) I'm redirected to my custom new tab page. Because that's my preference.

There. I've demonstrated how I set a the default search engine to my own custom search engine, that doesn't search for anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment