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.
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.
Share Improve this question edited Jan 19 at 13:28 jonrsharpe 122k30 gold badges266 silver badges473 bronze badges asked Jan 19 at 13:24 Laplace'sDemonLaplace'sDemon 1281 gold badge1 silver badge7 bronze badges 02 Answers
Reset to default 0Here's similar question: Can you determine if Chrome is in incognito mode via a script?
The FileSystem API is disabled in incognito mode.
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.