I'm trying to install a Chrome external extension using a visual studio setup project and following the instructions listed in http://code.google.com/chrome/extensions/external_extensions.html#registry, I did the following to add an external extension to Google chrome:
Packed the extension and moved the resulting .crx file to a folder C:\Hafez\Grid_Bootstrapper
I've added a registry sub key named fnfnbeppfinmnjnjhedifcfllpcfgeea under the following path: HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\Extensions\ with the next two values:
1.path with a value of "C:\Hafez\Grid_Bootstrapper\fnfnbeppfinmnjnjhedifcfllpcfgeea.crx" and
2.version with a value of "1.0.0.1"
which are, by the way, the exact values but unfortunately when I start Chrome the extension is not listed.
BTW, I'm doing this in a installer custom action and it writes the values exactly the way I want them.
I can't find what is wrong because I do the exact steps listed in the link.
May you discover what have I done wrong?
Related
Is there a way to copy an extension from a browser to another browser (both chromium based)?
In windows 10 I know the browser reads its data from this folder:
C:\Users<account_name\AppData\Local<browser>\User Data\Default
in Default there are several folders, among many:
"Extensions" and "Local Extension Settings"
which have as many folders inside as there are extensions installed and each of these folders has the extension id as its name.
So I tried copying Extensions\<id_ext> and "Local Extension Settings"\<id_ext> to their respective folders of another browser, but that wasn't enough.
Do I forget something (some other folder and\or registry key) or i's not possible to do this operation (without breaking the browser of course)?
EDIT
my goal is to have an old version of an extension fully installed in the browser (make the browser believe that it comes from the CWS) but in which I have disabled future updates (by modifying the update_url field in the manifest.json file with a fictitious address)
EDIT # 2
I will try to add two lines to better explain my purposes.
I've read something on SO and beyond, but nothing that can enlighten me about it.
My aim is to install an old version of an extension created by me
(I have the extension public key but I no longer have the private key), to block the update for a certain time and then update when I want by resetting the update_url field in the manifest.
Thanks
I've got a Visual Studio installer project (a vdproj) that won't install the VC redistributables as a pre-requisite. I can't figure out why.
I'm using the latest updates to Visual Studio 2019, with the Installer Projects extension. Here are my prerequisite settings:
At install time I get an error that says vc_redist.x64.exe has changed since it was initially published. I checked bootstrap at C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64 and discovered that the URL found there (https://aka.ms/vs/16/release/14.26.55555/vc_redist.x64.exe) redirects to the main microsoft home page and downloads HTML rather than an executable. So I changed the URL, first to https://aka.ms/vs/16/release/vc_redist.x64.exe, then to https://aka.ms/vs/16/release/14.27.29016/vc_redist.x64.exe. Both of these URLs download a copy of VC_redist.x64.exe when you visit them with a web browser, but neither of them fixes the installer.
The only difference I see after changing the URL is that with the original URL I get a file named vcredist_x64\vc_redist.x64.exe in the temp install folder (but it's invalid, full of HTML), but with the two new URLs the vcredist_x64 folder is empty.
Any idea what I need to do to get this working?
I found the solution. I needed change the URL and the public key. Here are the steps you would follow to resolve an issue like this in the future:
Find the URL to a version that is still available. The latest version is currently available from here: https://aka.ms/vs/16/release/vc_redist.x64.exe. The version-specific URL to that same file is currently http://aka.ms/vs/16/release/14.27.29016/vc_redist.x64.exe.
Note the version number. If you don't already know it, you can get it by simply hovering over the downloaded file in file explorer.
Find the public key. I learned how to do that from an answer in this question. You find the key by right-clicking on vc_redist.x64.exe, selecting properties, Digital Signatures, then double-click on the sha1 entry. Click View Certificate, then Details, then Public key. Copy the value that shows up in the text box.
Remove all the spaces from the public key you copied. The public key for v14.27.29016 of vc_redist.x64.exe is:
3082010a02820101009208daf213e09ec32da6e2dfdaef8c19ec2f584f0bf53f20b806f33f91258f36cf27d114def85bd87d4f84f6e7f4b7b9d8940cc78cafa99627f60610fe36076121443cb15c163b7f6d8ef4111e33f6fffbd2bc87e69a446830bd488678ecf64422650cd8443618469f71490626470423939865f3f53b4603a24038ad547694ec14f5308f7695f651b882030d805dbd7b5b7256093153b0a99b6fd0ef73402adeb7a47e7d148668335f104a5c20b2fe0fb455dcce2e6891384dae8a00e76f57e315689a7561715364f2ada631cee9df691d03d9886ecd742e906e74469ac6b8f2e350adbe807e62ca0c8d4ba77d56328813697e6d65ff82653f4f4aebe33822cd0203010001
Open C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\product.xml in a text editor, as administrator.
Replace the value of the PublicKey with the key you prepared in step 4.
In the BypassIf element, replace the Value with the version you noted in step 2. Save and close the file.
Open C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\vcredist_x64\en\package.xml in a text editor, as admin.
Replace VCRedistExe with the URL from step 1. You can use either the generic or the version-specific URL. They both have drawbacks. Save and close the file.
Rebuild your installer.
You may need to make adjustments for your environment.
Regarding the choice of URL, I suspect neither will work forever. If you use a version-specific URL, that version might go away (which is the whole reason we're needing to mess with this in the first place). If you use the version-agnostic URL, then when a new version comes out the product key probably won't match.
It's really unfortunate that Microsoft makes existing installers break by taking old redist packages down, and doesn't provide the updates required for new installers to work out of the box.
Firefox standard and beta version does not allow unsigned extensions, so I use Firefox developer edition and set xpinstall.signatures.required to false in about:config.
I download source from https://github.com/mdn/webextensions-examples and use my script to build xpi (after putting it to root directory of repo and copying my manifest-firefox.json as well).
For each extension, as you can see from the script, I copy it to a temp folder, modify manifest.json (remove chrome-only fields if any and add gecho for firefox) and zip all into one file.
However, when I tried to install them one by one, I failed to install all.
Every time I installed one, it would replace previous.
Steps:
Click Menu bar - Tools - Add-ons to open Add-ons Manager
Click Extensions and then gear on the right
Click Install Add-on From File and choose one under path/to/webextensions-examples/dist
Did I miss anything in my build script to cause this? Or is this as designed to only allow one unsigned extension?
I'm 4 years too late but for anyone that finds this question later this is due to having the same "id" for the multiple extensions if you're using "browser_specific_settings" in your manifest
Is it possible to run a chrome extension from command line?
I need to automate the process for my software, and my software will need to run that extension with a particular parameter.
I am using a Chrome Extension 'APK Downloader' by Yogi. The Extension works like this:-
"If a page contains any .apk file link, then when I click on the extension's icon on the address bar, it starts direct download of that .apk file"
Now, I have my software that needs some .apk file to download [The software will have the package name of the .apk file to be downloaded, which is used by the extension to generate a download link]. It will be an automatic process. So, I need to know if it is possible to pass a parameter to the extension automatically, and make the extension to work without clicking on it.
Is it possible to do so??
Unpacked extension can be loaded using the --load-extension= flag.
What I usually do is chromium --user-data-dir=/tmp/someuniquedirname --load-extension=path/to/extension --no-first-run.
The --user-data-dir= flag is used to specify a non-default user data directory, to minimize conflicts between your existing browser profile and the test directory. You can omit this flag if you want to use your default user profile.
The --no-first-runflag prevents the first run UI from showing up (e.g. the bubble that explains how to use the omnibox, and a "Getting Started" page that opens in a new tab).
You can load multiple extensions by separating the paths by commas, e.g. chromium --load-extension=path/to/one/extension,path/to/another/extension.
I have published some shell scripts and a convenience extension to speed up (manual) testing of Chrome extensions. Take a look at https://github.com/Rob--W/extension-dev-tools/tree/master/chrome.
it helps to open extension normally and after that hit F12 (dev tools) to see actual url...
having that i can, for example load "Selenium IDE" chrome extension as
(run from command prompt)
"C:\Program Files (x86)\Google\Chrome\Application\new_chrome.exe" chrome-extension://mooikfkahbdckldjjndioackbalphokd/index.html
on a mac:
osascript <<EOD
set theURL to "chrome://extensions/"
tell application "Google Chrome"
if windows = {} then
make new window
set URL of (active tab of window 1) to theURL
else
make new tab at the end of window 1 with properties {URL:theURL}
end if
activate
end tell
EOD
Question answered here:
https://superuser.com/a/979678
I have a windows application which installs a Chrome extension via the windows registry. I wish for this application to generate some one-time information for Chrome to read based on information typed in by the user during the installation process.
Assuming I am not using NPAPI in the Chrome extension, is there anywhere the installer can place information such that the extension will see it?
Edit: I also wish to launching chrome at the end of the installation.
Another way you can pass information to an installed extension from outside of Chrome is to have a page with your extension that you then open Chrome too and pass the info in the hash...such as....
chrome.exe "chrome-extension://emcggffhhapbbkcodabdliakappfibcf/showHash.html#info"
Problem with this method is your installing the extension using the simple registry method (Im guessing) and not using the Policy method. With the Policy method you can force an install and it will happen even if Chrome is allready open (where as according to the docs the simple method happens the next time Chrome is opened). Downside to this is you will have to make an uninstaller yourself as you cant uninstall an extension from Chrome that is installed with this method. Im also not sure how quick/often it will be before the extension is installed (couldnt find it in the docs and too lazy to try it ;)) and youd need to make your installer wait a bit for it to be installed....
http://www.chromium.org/developers/how-tos/adding-new-policies
http://dev.chromium.org/administrators/policy-list-3#ExtensionInstallForcelist
http://dev.chromium.org/administrators/policy-templates (says where in the registry to add them)
Another possible method could be to pack the extension at install time and add a file with the info that the extension could read. Problem with this method is that the extensions ID would change (might not be a problem for you?) or youll have to include the PEM in your installer which you probably dont want to do....
chrome.exe --pack-extension="C:\simple-example" --no-message-box
Many people wish there were an event firing on extension installing.
There's a workaround, not elegant way to send info to the browser from outside: launch chrome asking to open an url.
I use it with a local html file. My application execute a command line like:
"pathToChrome\Chrome.exe" "file://pathToHtmlFile/myFile.html?param1=value1¶m2=value2"
The info I pass are the page's parameters.
The catch is that this page is read by the extensions in one of many ways:
You can write a content script this page will fire
You can put some javascript on this page to write down the parameters as cookies, for the extension to read in the future (without calling the extension at this time)
It hasn't to be a local page. If your page is on a server, it can save the parameters in the server, ir it worthy.
It hasn't to be even your page. You can call any page on Internet, but beeing sure it will fire your content script extension, and it will read your "customized" parameters.
Instead of communicating through the windows registry, you can create a WebSQL from the installer and from the extension read the data from there.
You will need to a bit of research about how to this, but this is possible. the steps should be:
The installer will create the database and register to chrome (maybe with the Databases.db)
The extension will use openDatabase to create a connection to the database
The extension will do a transaction and read the needed file.
Another option is to add file to the crx for example "installer_info.json" and do an AJAX request from the extension to the "installer_info.json" file.
There is no formal way for doing this things, little research and you will have a way.