0

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.

0

2 Answers 2

0

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

The FileSystem API is disabled in incognito mode.

0

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.