How to create a chrome extension

  1. See the useless official document
    https://developer.chrome.com/extensions/getstarted

  2. See my codes
    https://github.com/yingshaoxo/No_More_Chinese/tree/example-of-chrome-extension

  3. Core question

  • Content scripts have only limited access to Chrome APIs. This access does not include the API you are trying to use (e.g. chrome.tabs). If you need to use that API, you will have to do so in a background script.

  • You are going to need to separate your code into what needs to be in a background script and what needs to be in content scripts, based on the capabilities available to each type of script. Content scripts have access to the DOM of the web page into which they are injected, but limited access to extension APIs. Background scripts have full access to the extension APIs, but no access to web page content.

  • https://developer.chrome.com/extensions/messaging#simple

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,490评论 0 10
  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,567评论 5 6
  • 编译后的二进制代码才是机器语言,或者叫机器代码。汇编语言亦称为符号语言。编译器将源程序转换成机器能理解的程序。无符...
    小白教你学Cplusplus阅读 196评论 0 0
  • 晨,一幅图片配上一段文字出现在朋友圈,道一声早安。夜,一幅图片配上一段文字出现在朋友圈,道一声晚安。截止今天...
    快乐777阅读 436评论 0 0
  • 至人之用心若镜,不将不迎,应而不藏,故能胜物而不伤。 译文:至高无上的用心好象镜子,照过的不去送,未照的不去迎,现...
    Sunny飞镜阅读 170评论 0 0