How to bundle a Native Host with Chrome Extension and publish it? - google-chrome

I'm publishing a Chrome Extension that uses Native Messaging with a java application but it says that i cannot upload a double manifest ( one for the extension, the other one for the native host installation).
The only solution that i thought is to include the manifest of the java app inside the extension manifest (but i'm not sure it's possible, could you confirm please) OR to upload somewhere else the native host app (including its manifest) and let the user to download and install it. Is there another way?

Chrome extensions cannot include additional software which runs outside Chrome, like native host apps.
You will need to distribute your Java application (and its associated application manifest) separately from the Chrome extension.

You can't include multiple manifest files.
For native message host, please try to refer this link
https://developer.chrome.com/apps/nativeMessaging#native-messaging-host

Related

Chrome extension gives following error "This extension may have been corrupted."

I published my extension on following link https://chrome.google.com/webstore/detail/poenibgdeeoelggbbbhdddojjjglhdjm/publish-accepted?authuser=0&hl=en.
When the extension runs the nativemessaging host and native messaging host sends a message it shows following error This extension may have been corrupted., and stops working.
The extension works fine in developer mode.
This extension may have been corrupted.
This is a message that Chrome shows if any of the files inside the extension folder change. When an extension is published, Web Store adds a Google-signed list of file hashes to the extension (in the _metadata folder), and any detected change is interpreted as a hijack attempt and leads to the extension being disabled.
You don't run into this in development mode, because Chrome does not consider file changes as abnormal (it is, after all, in active development).
If this is what your native component does (e.g. adds files to the extension or changes them), you can't use this technique. In particular, this does not allow you to change the extension's code externally.
Use other methods of storage of variable information in an extension, e.g. the storage API or IndexedDB, and other methods of communication, e.g. the native host communication protocol or a local webserver in the native component (but think about security if you're doing that).

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

How to make a .crx file installer?

I have made many CRX files for Google Chrome, and I was wondering if there was a way for someone to download the CRX file from my website and have it automatically installed (like it does for the Chrome Webstore)?
There's a special API from Google to install applications and extensions inline from your website. However, it is still hosted in the Chrome Web Store. The advantage is that user doesn't have to leave your website. It is called chrome.webstore API.
Nice read about API itself:
https://developer.chrome.com/extensions/webstore.html
More about inline installation:
https://developers.google.com/chrome/web-store/docs/inline_installation.

Upload extension in to app store with .crx and some addition files

I've developed extension for Chrome and I want to upload it in to Crome app store, but the issue is in that I have not only .crx file, which is needed but also some other files and dlls which should be installed in to "program files" folder.
So how can I upload my extension in to app store with .crx and some addition files?
Though I can't think of any reason why a Chrome Extension would need to install any DLLs, it is possible according to the Chrome Extension Developer FAQ. You'll end up using the NPAPI Plugin to access your DLLs, though you will need to go through an additional security review before your application gets published.

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