Chrome Extension:How to show background image in new Tab

无人久伴 提交于 2021-02-04 19:28:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!