Chrome扩展内联安装过程 [英] Chrome Extension Inline install procedure

查看:243
本文介绍了Chrome扩展内联安装过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < link rel =chrome-webstore-itemhref =chrome.google.com/webstore/detail/itemID> 

我在我的html页面上添加了以上代码(我的网站被用户点击) chrome扩展已经在chrome商店和javascript函数中发布 chrome.webstore.install()



用户在他的计算机上安装chrome扩展程序? 解决方案

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



首先,为此您需要通过网站管理员工具验证网站是否属于您自己的网站。


已验证的网站要求



出于安全原因,内联安装只能由 verified (via 网站管理员工具)与Chrome网上应用店中的该项关联。请注意,如果您验证域的所有权(例如, http://example.com ),则可以启动内联安装任何子域或页面(例如, http://app.example.com http://example.com/page.html )。


验证完您的网站后,您需要通过开发者控制台修改您的附加信息列表,以选择该附加信息与您的(已验证)网站相关联: >






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





在那里,他们可以在不打开网上商店的情况下接受或拒绝。您无法安静地安装扩展程序,但您可以为用户省去进入商店列表的麻烦。


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

I have added above code on my html page (my website hit by user) which is associated with my chrome extension already published in chrome store and javascript function chrome.webstore.install().

Will it really make user to install the chrome extension in his computer?

解决方案

The documentation: https://developer.chrome.com/webstore/inline_installation

First off, for this to work, you will need to verify the website as something you own via Webmaster Tools.

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).

Once you verified your site, you need to edit your extension listing via Developer Console to select that the extension is associated with your (verified) site:


If you have done all that, added the link tag and triggered the install() function (which, if I remember correctly, has to be triggered by a user action, like a click handler), the user will be presented with a small dialog describing your extension, something like that:

There, they can accept or deny without opening Web Store. You cannot silently install an extension, but you can save the user the trouble of going to the Store listing.

这篇关于Chrome扩展内联安装过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆