blog.thomasorlita.com

How to change the New Tab Page in Chrome

Chromium doesn't offer a direct way to change the New Tab Page to a custom URL. However, you can change this with a few lines of JavaScript using a Chrome extension. [1]

background.js

chrome.tabs.onCreated.addListener(function (tab) {
    if (tab.pendingUrl === 'chrome://newtab/' && tab.url === '') {
        chrome.tabs.update(tab.id, { url: "https://example.com" });
    }
});

manifest.json

{
    "name": "NTP",
    "description": "Overrides the new tab page",
    "version": "1.0",
    "manifest_version": 3,
    "permissions": [
        "tabs"
    ],
    "background": {
        "service_worker": "background.js"
    }
}

If you use a different search engine than Google and want to continue to use the native New Tab Page, set the URL to chrome://new-tab-page/. [2]


  1. Add these two files into an empty folder somewhere, go to chrome://extensions/, enable Developer mode, click Load unpacked, select the folder, and that's all. ↩︎

  2. chrome://new-tab-page/ doesn't work in Incognito mode, so don't enable this extension in Incognito mode. ↩︎