gpt4 book ai didi

javascript - Chrome 扩展内联安装过程

转载 作者:行者123 更新时间:2023-11-30 07:14:44 25 4
gpt4 key购买 nike

更新:Google 已禁用 Chrome 扩展程序的内联安装功能。

<link rel="chrome-webstore-item" href="chrome.google.com/webstore/detail/itemID">

我在我的 html 页面(我的用户访问的网站)上添加了上面的代码,它与我的 chrome 扩展程序相关联,该扩展程序已经在 chrome 商店和 javascript 函数 chrome.webstore.install() 中发布。

它真的会让用户在他的计算机上安装 chrome 扩展吗?

最佳答案

文档:https://developer.chrome.com/webstore/inline_installation

首先,要使其正常运行,您需要通过网站站长工具验证该网站是否属于您。

Verified site requirement

For security reasons, inline installations can only be initiated by a page on a site that is verified (via Webmaster Tools) as being associated with that item in the Chrome Web Store. Note that if you verify ownership for a domain (for example, http://example.com) you can initiate inline installation from any subdomain or page (for example, http://app.example.com or http://example.com/page.html).

一旦您验证了您的网站,您需要通过开发者控制台编辑您的扩展程序列表,以选择该扩展程序与您的(已验证)网站相关联:

Developer Dashboard


如果你已经完成所有这些,添加链接标签并触发 install() 函数(如果我没记错的话,它必须由用户操作触发,比如点击处理程序) ,用户将看到一个描述您的扩展的小对话框,类似这样的内容:

Example

在那里,他们可以在不打开网上商店的情况下接受或拒绝。您无法静默安装扩展程序,但可以免除用户前往商店列表的麻烦。

关于javascript - Chrome 扩展内联安装过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29818685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com