`

chrome extension官方reference摘要

阅读更多
At a high level, we'll use it to declare to Chrome what the extension is going to do, and what permissions it requires in order to do those things.

Many extensions have a background page, an invisible page that holds the main logic of the extension. An extension can also contain other pages that present the extension's UI. If an extension needs to interact with web pages that the user loads (as opposed to pages that are included in the extension), then the extension must use a content script.

There are two types of background pages: persistent background pages, and event pages. Persistent background pages, as the name suggests, are always open. Event pages are opened and closed as needed. Unless you absolutely need your background page to run all the time, prefer to use an event page.

The HTML pages inside an extension have complete access to each other's DOMs, and they can invoke functions on each other.

If your extension needs to interact with web pages, then it needs a content script. A content script is some JavaScript that executes in the context of a page that's been loaded into the browser. Think of a content script as part of that loaded page, not as part of the extension it was packaged with (its parent extension).

Content scripts can read details of the web pages the browser visits, and they can make changes to the pages.

In the following figure, the content script can read and modify the DOM for the displayed web page. It cannot, however, modify the DOM of its parent extension's background page.

Content scripts aren't completely cut off from their parent extensions. A content script can exchange messages with its parent extension, as the arrows in the following figure show. For example, a content script might send a message whenever it finds an RSS feed in a browser page. Or a background page might send a message asking a content script to change the appearance of its browser page.

In addition to having access to all the APIs that web pages and apps can use, extensions can also use Chrome-only APIs (often called chrome.* APIs) that allow tight integration with the browser. For example, any extension or web app can use the standard window.open() method to open a URL. But if you want to specify which window that URL should be displayed in, your extension can use the Chrome-only tabs.create method instead.

The HTML pages within an extension often need to communicate. Because all of an extension's pages execute in same process on the same thread, the pages can make direct function calls to each other.
分享到:
评论

相关推荐

    Chrome Extension (Chrome插件)开发官方最新文档(20190401)

    Chrome扩展(Chrome插件)是谷歌浏览器上的应用程序,它们能够增强和定制用户的浏览体验。这些插件是由HTML、CSS...通过学习官方文档(如chrome_doc),开发者可以深入理解这些概念并创建出满足用户需求的高质量插件。

    Chrome浏览器插件axure-chrome-extension

    Chrome浏览器插件Axure Chrome Extension是一款专为Axure RP设计的工具,旨在增强Axure原型在Chrome浏览器中的体验。Axure RP是一款广泛使用的交互原型设计软件,它允许设计师快速创建 wireframes、prototypes 和 ...

    axure-chrome-extension-V0.6.3

    对于Axure Chrome Extension V0.6.3,用户应从官方渠道下载,以保障数据安全和隐私。 综上所述,Axure Chrome Extension V0.6.3 是一款旨在提升Axure原型设计流程效率和协作体验的工具,通过浏览器内的即时预览和...

    axure-chrome-extension(axure浏览器插件).zip

    Axure Chrome Extension是一款专为Axure设计的浏览器插件,它极大地扩展了Axure原型在谷歌浏览器中的功能,使得交互设计师和产品经理能够更便捷地在浏览器中预览、测试和分享他们的原型作品。这款插件的使用对于提高...

    axure_chrome_extension_V0.6.3

    如果你在用谷歌浏览器打开Axure生成的本地HTML文件时,提示安装扩展程序Axure RP Extension for Chrome,但是按照中文网提供的安装方法,在最新版的谷歌浏览器中已经无法安装成功。会提示:程序包无效:“CRX_HEADER...

    OpenAI Translator Chrome Extension

    OpenAI Translator Chrome Extension是一个Chrome浏览器扩展程序,它可以利用OpenAI的语言模型进行多语言翻译。用户只需要选中需要翻译的文本,然后点击扩展程序图标即可获得快速准确的翻译结果。该扩展程序可用于...

    axure_chrome_extension_V0.6.3 插件与安装教程

    Axure Chrome Extension V0.6.3 是一个专为网页原型设计工具Axure设计的浏览器扩展,它极大地提升了用户在Chrome浏览器中预览和编辑Axure RP项目时的效率和便利性。本教程将详细介绍该插件的功能以及如何进行安装。 ...

    原型图插件 axure-chrome-extension-V0.6.3

    "原型图插件 axure-chrome-extension-V0.6.3"是针对谷歌浏览器(Chrome)的一个扩展,旨在帮助用户更方便地查看和测试Axure制作的原型设计。 首先,让我们深入了解一下Axure。Axure RP(Rapid Prototyping)是一个...

    谷歌扩展程序之axure-chrome-extension.zip

    标题中的“谷歌扩展程序之axure-chrome-extension.zip”指的是一个专门为谷歌浏览器(Chrome)设计的扩展程序,这个扩展程序的名称是“Axure Chrome Extension”。Axure是一款流行的产品原型设计工具,它允许设计师...

    Axure谷歌浏览器插件axure-chrome-extension下载

    Axure导出的html文件在浏览器中打不开,是因为浏览器缺少“axure-chrome-extension”插件导致。只需要在扩展程序中安装一个插件“axure-chrome-extension”,就可以解决问题了。

    chrome-extension-network.zip

    "chrome-extension-network.zip" 是一个包含示例代码的压缩包,专门针对Chrome扩展中的网络模块,旨在帮助开发者理解和实践如何利用网络接口进行各种网络操作。在本篇文章中,我们将深入探讨Chrome扩展的网络模块...

    Chrome插件Axure RP Extension for Chrome下载

    Axure RP Extension for Chrome是原型设计工具Axure RP的Chrome浏览器插件。因为在线安装需要访问Google Chrome在线商店,访问不了。所以提供一个离线版本进行安装。 安装方法: 1、打开Chrome浏览器,找到“工具 ->...

    axure-chrome-extension插件

    Axure Chrome Extension是一款专为网页原型设计工具Axure RP设计的浏览器扩展,它极大地提升了Axure原型在Chrome浏览器中的预览和协作效率。这款插件允许用户直接在Chrome浏览器中查看和测试Axure RP创建的原型,...

    axure_chrome_extension_V0.6.3.rar

    安装过程中,可能需要开启Chrome的“开发者模式”,因为官方应用商店可能不包含所有第三方插件。 使用这款插件,用户可以实现以下功能: 1. 直接在浏览器中预览Axure原型,无需切换到其他应用程序。 2. 快速分享...

    AXURE插件 axure_chrome_extension_V0.6.3.zip

    或者,将您的 RP 文件上传到Axure Share,扩展是 Google Chrome 的可下载插件,可修改浏览器并允许您使用其他功能,安装此扩展程序就可以在谷歌浏览器查看本地文件,此扩展程序需要高访问级别才能查看 file:// 协议...

    axure_chrome_extension_V0.6.3.zip

    “axure_chrome_extension_V0.6.3.zip”是一个专门为Axure RP设计的Chrome浏览器扩展程序。这个压缩包包含了插件的安装文件和可能的相关文档。Chrome扩展是Chrome浏览器的一种增强功能,它可以通过添加新的功能或...

Global site tag (gtag.js) - Google Analytics