问题
I am willing to have a similar functionality like given in popular extensions like Moments or Limitless which show beautiful wallpaper.
How can I implement it? Also, if multiple similar extensions are installed who shows image on new tab, is there way to let chrome show my image in tab first?
Thanks
回答1:
This is possible by indicating a different new tab page in the chrome_url_overrides
property in the manifest.json
:
{
"name": "My extension",
"chrome_url_overrides" : {
"newtab": "myNewTabPage.html"
}
}
Then you can modify the myNewTabPage.html
with background image you need, attaching the necessary stylesheets and assets.
Check here more details about overrides.
If multiple similar extensions are installed The new tab override will be managed by the latest extension installed on Chrome and this behavior cannot be changed.
来源:https://stackoverflow.com/questions/35474200/chrome-extensionhow-to-show-background-image-in-new-tab