2

I want to insert a javascript file into the original new tab page of chrome to be executed, I tried this but error in matching when I'm trying to load the extension.

"content_scripts": [
{
  "matches": ["chrome://newtab/*"],
  "js": ["jquery.js", "myscript.js"]
}
 ]
1
  • I don't wanna replace the original 'new tab page' of chrome with a new one , I just want to execute this javascript code on the original tab of chrome. Commented Dec 4, 2011 at 2:46

2 Answers 2

1

You cannot do that, you need to use override pages to do this.

{
  "name": "My extension",
  ...

  "chrome_url_overrides" : {
    "newtab": "myPage.html"
  },
  ...
}
Sign up to request clarification or add additional context in comments.

3 Comments

I don't wanna replace the original 'new tab page' of chrome with a new one , I just want to execute this javascript code on the original tab of chrome.
ok, can I get the thumbnail and links of chrome new tab page??
Inspect the New Tab page, you will see chrome://thumb/https://plus.google.com/ for links, you need to use the History API in chrome.
0

Add this to your matches: "matches": ["*://*.google.com/_/chrome/newtab*"]

That url looks like an implementation detail, so no guarantees it won't change, but for now it works.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.