本文介绍了自动安装Google Chrome扩展程序将无法使用!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在从事与此页面有关的工作。 http://code.google.com/chrome/extensions/external_extensions.html 我写了一个试图自动安装Chrome扩展的NSIS脚本。 (为什么?因为我们的扩展可以通过复选框与其他产品安装流程一起提供,那么如果用户选择要添加的扩展,它将使用NSIS静默安装在用户浏览器上自动安装) 我尝试了很多场景,我需要帮助,在谷歌网站上,他们说你可以这样做 使用首选项JSON文件 使用Windows注册表 说:使用首选项文件有一个错误(Windows注意:直到错误41902修复,你可能想使用Windows注册表,而不是首选项文件。) http://code.google .com / p / chromium / issues / detail?id = 41902#makechanges 提醒: An自动安装的扩展名称称为外部扩展名 所以我尝试使用Windows注册表 要通过注册表添加Google Chrome扩展程序: 添加此项:HKEY_LOCAL_MACHINE \SOFTWARE\Google\Chrome\Extensions(my extension id) 添加路径以.crx的路径 在扩展版本中添加版本 这是我试过的(使用NSIS脚本): 如果我添加一个注册表键它会安装扩展名,但如果用户手动卸载,chrome将打开黑名单标志,并且扩展名不能用任何其他脚本重新安装。剩下的唯一方法是用户手动安装。最糟糕的是,如果用户手动安装并手动卸载(它会关闭黑名单标志),并且当Chrome将重新启动时,它将自动重新安装扩展(无需任何用户操作),因为注册表项仍然存在。 如果我在启动或关闭浏览器时删除注册表项,通过一种奇怪的方式(在crx中使用dll(NPAPI)),chrome会自动删除在浏览器重新启动时扩展目录。 如果我设法在用户卸载扩展时删除注册表项。我们被列入黑名单,所以自动安装程序将不再工作,直到用户通过手动安装和卸载扩展程序关闭黑名单标志。 目录在 C:\ Users \(username)\AppData\Local\Google\Chrome\User Data\Default\Extensions\(extensionID)\(version )_0 \(我的文件在这里) ,我遇到了很多麻烦,因为只要重新启动浏览器,chrome就会删除我的文件。 有没有人遇到过这个问题,以及需要做些什么。 我会尝试使用JSON文件,但是直到错误没有解决,注册表才是唯一的方法。 感谢任何有时间阅读所有内容的人这个 ! 任何帮助将不胜感激,谢谢!解决方案 [ 2013-11-11 ] [这个问题的答案即将过时,所以这是一个更新的答案。] 根据 最近的帖子 在Chromium博客上,自动安装Chrome扩展程序不会在短期内成为一种选择: 因此,基本上,您需要做的是: 在Chrome网上应用店中托管您的扩展程序optionaly将它从列表中隐藏起来)。 让您的安装程序打开指向您网站上的网页的Chrome浏览器窗口。 在该页面上为用户提供所有必要的信息和数据以启动延期的安装过程。 (这里的关键概念是 user 必须通过点击按钮来启动安装过程。 嵌入式安装如何工作: $ b 要在其上进行内联安装的网站上的HTML页面必须在引用用户可以安装的项目的部分中包含一个或多个标记,每个标记必须具有以下格式: < link rel =chrome-webstore-itemhref =https://chrome.google。 com / webstore / detail / itemID> (强调我的) 有关 内嵌安装功能 。I am working on a job in relation with this pagehttp://code.google.com/chrome/extensions/external_extensions.htmlI wrote a NSIS script that is trying to auto install a chrome extensions.(Why ? because our extension can be offered with another product installation flow through a checkbox, then if user select our extension to be added, it will auto-install on the user chrome browser using NSIS silent installation)I tried a lot of scenario and I need help, on google website, they say you can do thisUsing a preferences JSON fileUsing the Windows registryThey also say that "Using a preferences file" has a bug (Windows note: Until bug 41902 is fixed, you might want to use the Windows registry instead of the preferences file.)http://code.google.com/p/chromium/issues/detail?id=41902#makechangesReminder:An extension that's installed automatically is known as an external extensionSo I tried "Using the Windows registry"To add a google chrome extensions through registry:add this key: "HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions(my extension id)"add "path" with the path to a .crxadd "version" with the version of the extensionThis is what I tried (using NSIS script):If I Add a registry keyIt will install the extension, BUT if user uninstall manually, chrome turns the blacklist flag on and the extension can't be reinstalled with any other script. The only way left is that user installs, manually. Worst, if user install manually and uninstall manually (it will turn the blacklist flag off), and when chrome will be restarted, it will reinstall the extensions automatically (without any user action) since the registry key is still there.If I remove the registry key when we start or close the browser, through a freaky way (using a dll(NPAPI) within the crx), chrome will auto-delete the extensions directory when browser restarts.If I manage to delete the registry key when user uninstall the extension. We get blacklisted, so the auto-installer won't work anymore until user turn blacklist flag off by manually installing&uninstalling the extension.If I create the directory in "C:\Users\(username)\AppData\Local\Google\Chrome\User Data\Default\Extensions\(extensionID)\(version)_0\(my files here)", I run into a lot of trouble because chrome will delete my files as soon as it restarts the browser.Does anyone have run into this problem, and what has to be done.I will try with the JSON file but until bug isn't fixed, Registry is the only way.Thank for anyone who had the time to read all this !Any help will be appreciated, thanks! 解决方案 [2013-11-11][The answers to this question are about to become outdated, so here is a more up-to-date answer.]According to a recent post on the Chromium Blog, auto-installing a Chrome Extension won't be an option in the near future:As an alternative, developers and vendors will be able to use the inline installation feature:So, basically, what you need to do is:Host your extension on the Chrome Web Store (optionaly keeping it hidden from the listings).Have your installer open a Chrome browser window pointing to a webpage on your site.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, e.g. by clicking a button.How does inline installation work:<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/itemID">(emphasis mine)More info on the inline installs feature. 这篇关于自动安装Google Chrome扩展程序将无法使用!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-06 02:27