I am currently building a simple google chrome extension to prank my brother. The Extension simply deletes the old page and replaces it with HTML and CSS copied off of the \
As of Chrome v61, content scripts are no longer allowed on the New Tab Page.
The URL of the new tab page has changed to chrome-search://local-ntp/local-ntp.html
.
If you want to create a custom New Tab Page, use override pages.
I decided to delete the original content of this answer to avoid possibly misleading somebody. The original answer can be viewed in edit history.
Opened a new tab, opened the Dev Tools - Network tab. Looks like it requests https://www.google.com/_/chrome/newtab. Try with this one, maybe.
It's probably safer to use "exclude_globs"
instead of "exclude_matches"
. With "exclude_matches": ["*://*/_/chrome/newtab*"]
you could unintentionally skip something like http://example.com/_/chrome/newtab:
"content_scripts": [{
"matches": ["<all_urls>"],
"exclude_globs": ["https://www.google.*/_/chrome/newtab*"],
"run_at": "document_end",
"js": ["script.js"]
}],
According to Match Patterns, chrome
is not a valid scheme.
scheme := '*' | 'http' | 'https' | 'file' | 'ftp'
You could use the following exclude_matches
"exclude_matches": ["*://*/_/chrome/newtab*"]
You could also check if window.location.href
contains chrome/newtab
in you content scripts.