简体   繁体   English

Chrome扩展安装

[英]Chrome Extension installation

I have chrome extension which get installed with using installer which install some process and browser extensions. 我有chrome扩展,可以使用安装程序来安装,该安装程序会安装一些进程和浏览器扩展。 As per chrome security changes stand alone installation will be blocked. 根据chrome安全性更改,独立安装将被阻止。 Google to block local Chrome extensions Google阻止本地Chrome扩展程序

If we host extension on chrome store what are the ways we can redirect chrome from installer to install extension. 如果我们将扩展程序托管在chrome存储上,可以通过什么方式将chrome从安装程序重定向到安装扩展程序。

According to the Chromium Blog : 根据Chromium博客

If your extensions are currently hosted outside the Chrome Web Store you should migrate them as soon as possible. 如果您的扩展程序当前托管在Chrome网上应用店外部,则应尽快进行迁移。 There will be no impact to your users, who will still be able to use your extension as if nothing changed. 不会对您的用户产生任何影响,他们仍然可以使用您的扩展程序,就好像什么都没有改变一样。 You could keep the extensions hidden from the Web Store listings if you like. 如果愿意,可以将扩展名隐藏在Web Store列表中。 And if you have a dedicated installation flow from your own website, you can make use of the existing inline installs feature. 并且,如果您有自己网站上的专用安装流程,则可以使用现有的嵌入式安装功能。

So, basically, what you need to do is: 因此,基本上,您需要做的是:

  1. Host your extension on the Chrome Web Store (optionaly keeping it hidden from the listings). 将扩展程序托管在Chrome网上应用店中(可以选择将其隐藏在列表中)。
  2. Have your installer open a Chrome browser window pointing to a webpage on your site. 让安装程序打开指向您网站上的网页的Chrome浏览器窗口。
  3. On that page have all necessary info and data for the user to initiate the extention's installation process. 在该页面上,具有所有必要的信息和数据,供用户启动扩展的安装过程。 (The key concept here is that the user has to initiate the installation process, eg by clicking a button. (此处的关键概念是用户必须启动安装过程,例如通过单击按钮。

How does inline installation work: 内联安装如何工作:

The HTML page on your site from which you want inline installation to occur must contain one or more tags in the section referencing the items that the user can install. 要在其上进行嵌入式安装的站点上的HTML页面,在引用用户可以安装的项目的部分中必须包含一个或多个标签。 Each tag must have the following format: 每个标签必须具有以下格式:

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

To actually begin inline installation, the chrome.webstore.install(url, successCallback, failureCallback) function must be called. 要真正开始内联安装,必须调用chrome.webstore.install(url,successCallback,failureCallback)函数。 This function can only be called in response to a user gesture , for example within a click event handler; 只能响应用户手势 (例如在click事件处理程序中) 来调用此函数 an exception will be thrown if it is not. 如果不是,则会引发异常。

(emphasis mine) (强调我的)

More info on the inline installs feature . 有关内联安装功能的更多信息。

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

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