Google Chrome - Extension vs App

自古美人都是妖i 提交于 2019-12-24 01:47:32

问题


I want to modify chrome start page, change background and maybe logo.

I want to include jQuery in users local storage and load it while users page loads ( search page )

I never done anything with chrome so I want some way where to start. Do I go reading with apps or extensions?


回答1:


As a rule of thumb: Choose an app if you want to develop an (independent) application that can stand on its own. If you want to interact with the browser (e.g. modify a web page), build an extension.

In your case, you definitely need an extension.

  • Change start page - use chrome_url_overrides in the manifest file to override newtab.
  • Locally store jQuery: Although it's possible to store jQuery in local storage, you're probably fine with packaging jQuery with your extension.
    To add it to your user's "search page", you have to use a content script. By default, content scripts run in an execution environment that is different from the page (the document's DOM is shared though). Usually, this behavior is desired. If you really want to expose the jQuery library to the scripts in the page, take a look at this answer.
    If you really want to load some script from a remote location and use it as a content script, read Chrome extension adding external javascript to current page's html.

I'm not sure what you mean by "change background and maybe logo". If you're referring to the browser's appearance, the only option to do that is by creating a theme. This must be a separate extension.



来源:https://stackoverflow.com/questions/20459309/google-chrome-extension-vs-app

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