How to link to chrome extension like Chrome Web Store? - google-chrome

I'd like to self host a chrome extension on my own site but would like the install experience to be the same as on the chrome web store. Specifically, I'd like to have a "add to chrome" button which asks the user to install the extension with one more click. Currently on self hosted extensions you have to confirm the download and then confirm the install.
Here's an example of the web store: https://chrome.google.com/webstore/detail/olnconaknblgbkfgknkfmmfhhbebkekd
The only reason I'd like to self host is so that they can stay on my site while installing the extension.
I'd be perfectly fine hosting on the chrome webstore as well if that helped with the experience (i.e. a special link from my site to the chrome webstore that would start the download immediately).
Any ideas?

Chrome webstore has special treatment, you can't reproduce it.
To save you trouble of self hosting, you can provide a direct link to crx file hosted on webstore which has the following format:
http://clients2.google.com/service/update2/crx?response=redirect&x=id%3D<EXTENSION_ID_HERE>%26uc%26lang%3Den-US&prod=chrome
Users would still need to confirm 2 times, but at least you don't have to host it and users won't leave your site.
UPDATE
Chrome 15, that was just released into stable branch, has Inline Installation, which seems like exactly what you are looking for.

Chrome now has inline install that enables a one-click install on your site but downloading from the store.
See here for more details.

Add something like this to your meta-data
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/you-chrome-id">
Add this any where:
onclick="javascript:chrome.webstore.install()"

Chrome no longer supports in-line installation of extensions.
https://developer.chrome.com/extensions/inline_faq
When your site calls chrome.webstore.install(), Chrome will no longer trigger a dialog immediately but will instead open a new foreground tab to the details page of the Chrome WebStore

Related

Chrome : Install extension(crx) manually doesn't work anymore

We built a chrome extension to be used only inside our company by selective people. We do not want to publish this on chrome web store. We could do this before by just drag & drop the crx file in the extensions page.
But in the latest version of chrome(i use 35.x), we are not able to do this anymore. Whenever we try to install the crx file, chrome automatically disables it and shows a message
"This extension is not listed in the Chrome Web Store and may have been added without your knowledge"
with a link to https://support.google.com/chrome/answer/2811969 where it says
"You're seeing this notification because one or more of your Chrome extensions has been turned off to make Chrome safer. The extensions didn't come from the Chrome Web Store or were installed without your permission."
So, Does this mean we can never install crx file from now on? No workaround?
I know we can install using Group Policy method, but is that the only way we can do this?
Thanks in advance.
Yes, this has been disabled as a protection against malware.
The only workarounds I'm aware of are:
turn on Developer Mode and have users install as an unpacked extension after unzipping the CRX
publish unlisted or to a Google Group: https://support.google.com/chrome/a/answer/2663860?hl=en

Apps, Extensions and scripts cannot be added from this website

I'm trying to add the Rapid Interface Builder extension to chrome using the rib.crx file I downloaded from https://01.org/rapid-interface-builder/downloads/2012/rib-preview-1-chrome-extension
Unfortunately, every time I open the crx file with chrome I get the following error:
Apps, Extensions and scripts cannot be added from this website.
Any ideas on how to fix this?
Instead of opening the file, you have to: extract it (crx are zip files), then visit chrome://extensions, enable developer mode, and load unpacked extension.
The reason for this is: lots of people try to abuse chrome apps/extensions to install nasty applications to your browser. So Chrome tries to make it impossible to automatically side-load these apps without you making sure that is really what you want to do.
So.. typical caveats of installing software apply when using this approach.
You can now also just drag-and-drop the .crx file onto the chrome://extensions page and it will install, too.
Edit 2019-01-10: Make sure to enable Developer mode for extensions. If this was not enabled, refresh the chrome://extensions page after enabling it.
Edit 2018-08-24: This works on Windows, too.
Edit:
This doesn't work on Windows. Verified on OSX and ChromeOS. From what I've read, this will work on Linux, too.~
(I initially experienced the same problem you described.*)
This solution worked for me in Windows 10 (build th1511) x64:
Open Chrome as you normally would.
Go to the "Extensions" page (chrome://extensions; or click Menu button at top right corner → From 'More tools' drop down menu select 'Extensions').
Drag and drop the .crx file onto the extensions page in Chrome -onto the list of extensions.
You should see a dialog stating "Drop here to install". This must be present. (If you do NOT see this, reposition your mouse - it may be too far to the side of the page.)
It should load successfully and you should see the extension in the list immediately afterward.
*I received the same error you described when attempting to load the .crx file (packed extension) by right-clicking/double-clicking it and selecting "Open With" "Chrome", and by dragging/dropping the file onto a regular webpage in Chrome.
In the Extensions page, just enable Developer mode. From there you can drag and drop any .crx file there and installation prompt will follow suit.
Open Chrome with this parameter --enable-easy-off-store-extension-install, then go to extensions and enable Developer mode. Now you can install .crx files without any problem.
go on extension, and your first step is on developer mode, 2 step update extensions, and last drop IDM extension file on google chrome.

How does Chrome App Launcher add itself?

If I want to install the Chrome App Launcher and navigate to https://chrome.google.com/webstore/launcher , then click the only button over there, that page will install Chrome App Launcher shortcut to my Windows taskbar without any confirmation from the operating system whatsoever.
If I use a different browser, other than Chrome, I get redirected to the Chrome Webstore, with a message "You will need Google Chrome to install most apps, extensions and themes." showing. I guess, Chrome is able to place a shortcut from within a web page to my Desktop/Taskbar via its inner methods, as it's a general executable and may do "a lot" on its own.
How can I add my (any) shortcut from within a web page rendered in Chrome the same (or another) way the Chrome App Launcher has been installed?
Sorry, the webstore has special powers in chrome which regular web sites don't get. This is how it can also install extensions and apps, see whether you have particular extensions and apps installed, etc. You can see API by which it gets these special privileges here.
This API is made available by chrome just to the webstore.

Deploying chrome extensions that are not in chrome webstore

I found that the chrome webbrowser recently disabled the ability to deploy extensions that are not from the chrome webstore. I tried opening my extension.crx directly intro chrome and it wont work anymore, it just download the file.
I know I could use the "load unpacked extension", but I need to do it in about 50 computers, so it's not a very practical way.
Does anyone knows any other ways to deploy an extension that is not in the webstore?
Maybe "loading an unpacked extension" programmatically from an .exe or something like that.
Have you tried dragging it over to Chrome, either from the download bar or the file browser on your operating system? I seem to remember this has been an issue earlier...
There is more information about how to complete this on the Chrome Dev site:
https://developer.chrome.com/extensions/crx
It looks as if you need to create a zip file, then add additional headers to the beginning of that file, then change the file extension from ".zip" to ".crx"
If serving this file from a web-server, you should use the header "application/x-chrome-extension" to make the Chrome browser understand this is an installable theme/app/extension.

How to install a Chrome extension programmatically?

I've written an extension for Google Chrome that will be released with the next version of our product. I want to understand what properties, paths for extraction, registry entries, etc. should I provide the installer of my product so that the end user doesn't have to install the extension on their own manually, and the installer does the complete job of installing the extension, and also notifies the user that the extension has been installed. As of now, the code that I have written is placed in a folder, and I use the "Load Unpackaged Extension" to load the extension. What should I do to achieve the aforementioned task?
Google's current policy on installing extensions via the registry (for Windows machines) is this:
Only extensions from the Google Extension Gallery (or Chrome Web Store - CWS) can be installed via the registry.
See this link - https://developer.chrome.com/extensions/external_extensions - for information on how this can be done. Keep in mind the following:
-This technique will still pop-up a msgbox to the user. its not completely silent.
-When using this technique, if the user subsequently removes the extension from her Chrome, the extension gets "blacklisted" on that chrome and will not re-auto-install until the user re-install it
manually. refer to Auto-installing a google chrome extension won't work ! for details.
Chrome has a couple ways of installing extensions programmatically:
http://www.chromium.org/administrators/pre-installed-extensions
Edit: yes, this policy has changed by now, as FuzzyAmi points out.
If you're using GNU/Linux, this is how you pre-install an extension from the chrome web store for all users:
/etc/chromium/policies/managed/yourextension_policy.json
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
{
"ExtensionInstallForcelist": [
"yourextensionuniqueidentifiersup;https://clients2.google.com/service/update2/crx",
"yourextensionuniqueidentifiersup"
]
}
Reference
metamask-chrome - AUR