How to locate Google Chrome extension dir - google-chrome

Hi i'm installing extensions by programmatically by a little c# program.
I just did see the software doesn't work on my friend.
i did see his chrome directory is not at %appdata% folder its at program files?
so how to find the real latest version of chrome directory for install plugins?
Google says
Windows:
chrome_root\Application\chrome_version\Extensions\
Example: c:\Users\Me\AppData\Local\Google\Chrome\Application\6.0.422.0\Extensions\
but how to find the chrome_root?

Visit chrome://version.
Look at Profile Path.
Extensions can be found in the Extensions subdirectory of the path you found at the previous step.
You can also load the extension using the --load-extension flag:
chrome.exe --load-extension=path/to/extension

The recommended mechanism for installing extensions programmatically is external extensions. It has the advantage of not depending on Chrome paths that might change, instead you can use a stable registry key or JSON file.

Related

Programmatically installing a chrome extension to the default profile [duplicate]

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

Offline google chrome extensions

Background:
I manage an offline network of workstations.
I have written a chrome extension that needs to be in the browser for our webapp to function
I have published it through the chrome store (but not made it public)
Question:
How do I install this extension without the internet
What I've tried:
Windows GPO: Requires the update URL to be http://clients2.google.com/service/update2/crx
Windows Registry: same URL problem
Unpacked extensions: prompts users, requires developer tools, and disables the extension when chrome is restarted.
install crx: disables the extension when chrome is restarted.
Any other ideas, or ways around this?
Chrome version 48.
I was able to do this on a regular chrome installation by doing the following:
Download the extension in crx format - how to download a crx file from the chrome web store for a given id
Unzip the crx file
I had to rename the _metadata folder to metadata
Open the chrome extensions page
Enable Developer mode
Click "Load unpacked extension..."
Select the unzipped folder
This worked for me when I needed to install Advanced REST client.
I have just:
Downloaded the add-on CRX file using http://crxextractor.com/
Opened the "extensions" page on Chrome.
Drag-and-dropped the CRX file onto the "extensions" page.
I got it to work actually, sadly forgot about this post until now.
I had the Business version installed as #gerardnimo suggested.
What I wound up doing is
1) setup and IIS server to serve both the CRX and the update xml. based on this guide. https://developer.chrome.com/extensions/autoupdate
2) Then i was able to install the extension via group policy.
Here is a thread that I've found. He suggests that you can use Google Chrome for Business.
Since September 3, 2015, Installing Chrome extensions off-line no longer work (and here ) due to Google trying to prevent malicious extensions being downloaded and installed. To install an extension off-line today, require you to install a signed pre-packaged full Chrome install, using Googles Chrome for Business. This functionality is controlled by a policy list. Or according to this post, you can use their Dev or Canary channels to run any extension. Their latest builds can be found here

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

Where does google chrome store unpacked extensions?

I just lost all my changes to my google chrome plugin. However, the plugin is still running within the browser.
Where does Google Chrome store its cached copy of unpacked extensions?
I was able to find luck in:
Non-windows 7:
C:\Documents and Settings\<username>\Local Settings\Application Data\Google\Chrome\User Data\<profile>\Extensions
-or-
Windows 7:
C:\Users\<username>\AppData\Local\Google\Chrome\User Data\<profile>\Extensions
EDIT: You can go to "chrome://version/" (like a url) and it shows your "Profile Path". There you can find an "Extensions" folder which is the one you're looking for.
Turns out that unpacked extensions are left in their original locations. Only packed extension get extracted to the places Alex.Piechowski mentioned.
On Linux (OpenSuse 12.3), I managed to find all my installed extensions here:
~/.config/google-chrome/Default/Extensions/
It's important to first take note of the extension ID in case u wish to just copy a particular extension. For this, open chrome://extensions/ in your browser, copy the id of the extension of interest, and find it's directory under the extensions directory given above.
Being able to locally save copies of extensions like this has helped me to continue using (and even modifying / hacking) on extension that were eventually removed from the Chrome Store by either their owners or Google.
So I was debugging an extension I am building on Mac OS X and couldn't find the SQLite database in any of the standard locations. It doesn't store the DB in the path where the extension files live.
Here's where I found my database when running an unpacked extension:
~/Library/Application Support/Google/Chrome/Default/databases/http_foobar.com_0/XX
-Eric
User profiles are stored in User Data Directory and it vary depending on the operating system.
The easiest way is to navigate to chrome://version and look for the Profile Path field.
Example (Windows):
[Profile Path] C:\Users\Alice\AppData\Local\Google\Chrome\User Data\Default
[User Data Dir] C:\Users\Alice\AppData\Local\Google\Chrome\User Data
Then Extensions are located under Extensions/ folder.
In windows:
Path: C:\Users\yourusername\AppData\Local\Google\Chrome\User Data\Profile 1\Extensions
(Here, you will not able to see extensions by name but it will be by extensions by Id. Extension Id you can get it from chrome→extension→Developer modes)
Or
Path: C:\Documents and Settings\yourusername\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions
Or
Download Extension Source Locator. Give your username. It will list out all the extension with path details.

Add external extension by using registry

I use Windows 7(64bit) and repeat steps in Google Document.
This is what I added in register.
In HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\Chrome\Extensions\nbfjanngloflombfddlmkgnambnfhgjc
path="C:\Extension.crx"
version="2.1"
But extension isn't install.
Before testing .crx file distribution,
I installed and uninstalled this extension with unpacked files many times by UI(chrome://extensions) for development and tested setting policy by using register. (But I removed all of them now.)
Does it cause any problem?
But when I tested same thing in another clean PC(Windows XP 32bit) nothing is changed, too.
I already checked some common mistakes in Google Document several times, but I can't find any mistakes.
- Not specifying the same id/version as the one listed in the .crx
- Key created in the wrong location in the registry
- Registry entry points to the wrong path to the .crx file (or path specified but no filename)
- Permissions problems on a network share
Are there other common mistakes I should check to install external extension?
According to this page - https://developer.chrome.com/extensions/external_extensions -
it is no longer possible to use the registry method to install locally-hosted .crx files.
in fact, the only allowed extension are those from Google's Extension gallery.
See a quote below from Google's policy page:
An extension that's installed automatically is known as an external extension. Google Chrome supports two ways of installing external extensions:
-Using a preferences JSON file (Mac OS X and Linux only)
-Using the Windows registry (Windows only)
Both ways support installing an extension hosted at an update_URL. In the Windows registry, the update_URL must point to the Chrome Web Store where the extension is hosted.
The extension-ID cannot be chosen at random.
I've installed your .crx file in Chromium 18 (Linux), and Chrome 18 (Windows 7 in VirtualBox), and the correct extension-ID is: lhmigopickaaleaaelbppeabnbdgcdhe
The version number has to match. In the manifest.json file, in the extension, I see "version": "1.0". So, the version entry in the registry has to be 1.0.
I was not able to install the extension via the registry using the steps from the Documentation. I've found two right ways to install the extension through the registry. Create a .reg file, and paste the text below to install the extension:
set_page_color_chrome-extension.reg (based on this file, md5: 10a1b95c249a2481bc88d3d1aead0e33).
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\lhmigopickaaleaaelbppeabnbdgcdhe]
"version"="1.0"
"path"="C:\\set_page_color.crx"
Replace HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER if you're running in permission trouble, or if you want to install the extension only for the current user.