Optional new tab page

235 views
Skip to first unread message

Huini Chen

unread,
Jun 14, 2021, 4:33:25 PM6/14/21
to Chromium Extensions
Hello!

I would like to add a custom new tab page feature in my extension, and this feature can be turned on/off by users. My extension has other features (like it has scripts to make login easier) so it does not make sense for me to tell the user to turn the extension off if they do not want a new tab page.

I have looked into the following approaches:

1. using "chrome_override_url" & redirecting the user to "chrome-search://local-ntp/local-ntp.html"  when a value in the storage indicates that I should not show custom page
Problem: If the user wants to use another new tab extension with my extension enabled, it does not work as they will be redirected to the default home page

2. Using chrome.tabs.onCreated and redirecting the user to my customized page using:

chrome.tabs.update(tab.id, { url:chrome.extension.getURL("newtab.html") })

when they opt into my custom new tab page.
Problem: The URL bar shows the location of the "newtab.html" file which is a bit awkward

Is there any other way I can implement this without making a new extension?

Thanks!

Huini Chen

unread,
Jun 14, 2021, 6:29:19 PM6/14/21
to Chromium Extensions
Also one other question: If we make an extension that overrides the new tab page, do you HAVE to use the prompt by Google Chrome that asks the user if they would like "Keep it" or "Change it back" (pick below)?Screen Shot 2021-06-14 at 6.27.31 PM.png

Simeon Vincent

unread,
Jun 15, 2021, 7:30:32 PM6/15/21
to Huini Chen, Chromium Extensions
Chrome does not support optional new tab pages in extensions. Rather, I believe that our current stance is that new tab pages are considered a single purpose for the sake of policy enforcement. As such, if you wish to provide an optional new tab page you should publish a separate extension that implements the new tab page functionality in order to give the user control over their new tab page experience.

Simeon - @dotproto
Chrome Extensions DevRel


--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/67bc6f8a-59ea-4923-97f4-8c4cc430a2fbn%40chromium.org.
Reply all
Reply to author
Forward
0 new messages