skip to Main Content

I want to make a custom landing page for when I open a new private tab.
Manage to do it in normal tab with a custom extension:

{
  "manifest_version": 3,
  "name": "Black Background New Tab",
  "version": "1.0",
  "description": "Changes the background color of new tabs to black.",
  "permissions": ["tabs", "activeTab", "storage"],
  "chrome_url_overrides": {
    "newtab": "newtab.html"
  },
  "host_permissions": ["<all_urls>"],
  "incognito": "spanning"
}

newtab.html:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>────────────────────────────────────────────</title>
  <style>
    <-- some style here
  </style>
</head>
<body>
  <-- some code here
</body>
</html>

But I cannot make it work in private windows/tabs.

2

Answers


  1. Chosen as BEST ANSWER

    Solved. Manifest.json:

     {
      "manifest_version": 3,
      "name": "Custom Private New Tab",
      "version": "1.0",
      "description": "Customizes the new private tab page.",
      "permissions": ["tabs", "activeTab"],
      "chrome_url_overrides": {
        "newtab": "newtab.html"
      },
      "incognito": "split",
      "background": {
        "service_worker": "background.js"
      }
    }

    Background.js:

    chrome.runtime.onInstalled.addListener(() => {
        console.log('Extension installed and background script running.');
      });

    And the newtab.html, only change to show personal data.


  2. Here’s similar question: Can you determine if Chrome is in incognito mode via a script?

    The FileSystem API is disabled in incognito mode.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search