简体   繁体   English

在我的网站上,以编程方式启动 Chrome 扩展程序的安装

[英]From my website, programmatically initiate the installation of a Chrome extension

How can I achieve this functionality in my web application?如何在我的 web 应用程序中实现此功能?

转到此位置以获得更好的理解

Here is the image showing the extension adding pop up:这是显示扩展添加弹出窗口的图像:

这是显示扩展添加弹出窗口的图像。

Everywhere in Stack Overflow and Google it is telling that we cannot add extension pop up like: Stack Overflow 和 Google 到处都在告诉我们不能添加扩展弹出窗口,例如:

How to programmatically open chrome extension popup.html 如何以编程方式打开 chrome 扩展 popup.html

How can we display this alert "add extension"?我们如何显示此警报“添加扩展名”?

What you are trying to achieve is known Inline Plugin Installation .您要实现的目标是已知的Inline Plugin Installation

Pre-requisite:先决条件:

Before adding inline installation you must:在添加内联安装之前,您必须:

  1. Publish your plugin on Chrome Webstore.在 Chrome 网上应用店发布您的插件。

  2. Must have your domain verified on Google Webmasters - Verified Site Requirement必须在Google 网站管理员上验证您的域 - 验证站点要求

Installation:安装:

Then, to prompt the user to install the plugin while they are still on your site (not redirecting to Chrome Webstore) follow these steps:然后,要提示用户在您的网站上安装插件(而不是重定向到 Chrome 网上应用店),请按照以下步骤操作:

  1. Add a <Link /> to your Webstore Plugin, eg<Link />添加到您的网上商店插件,例如

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

    more details here .更多细节在这里

  2. Trigger the installation (say after the user clicks a button),触发安装(比如在用户单击按钮后),

     $('#install').on('click', function(){ if(window.chrome){ chrome.webstore.install(url, successCallback, failureCallback) } })

Make sure to checkout Official Documentation for more.请务必查看官方文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM