I have a Google Chrome extension. I want to have a C# application open when i click a button in an extension popup.
All the answers I've found are about google chrome apps and not google chrome extensions.
How i can do this ? I need a simple example.
Wheb using chrome
You can't have an app with a gui.
But you can use native messaging so your extension will talk by json messages with an executable that was coded using c++ or c# code.
https://developer.chrome.com/extensions/nativeMessaging
You cannot invoke any application directly from chrome extension or URL, but you can invoke application via chrome extension via URL handler and for that you have to register application to handle specific url scheme.
you can find more info on ms link :
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN
Another reference link
How do I register a custom URL protocol in Windows?
once you done with protocol handler registration you just have to invoke that url from extension.
best examples of URL handlers are :
Skype : callto:<screenname>
Email : mailto:<address>[?<header1>=<value1>[&<header2>=<value2>]]
Related
I am building a chrome extension which uses a back end (php) app with gmail API and because
i do not want to separate Google apps / i need to have the chrome extension consume a
backed API as i cannot whitelist a chrome extension for gmail API / use the existing web app.
To solve this i have put the extension app on a subdomain whitelisted for gmail API and i am loading this domain via an iframe into the chrome extension.
The issue is that the subdomain cannot access the chrome properties inside the iframe:
chrome.tabs.query or chrome.runtime.onMessage
to enable talk to the content script.
i get the error
chrome is not defined
What is the best solution for this?
I need to combine functionality available only in a Chrome packaged app (access to syncFileSystem) and functionality available only in a Chrome extension (injecting a script into a 3rd party website).
It seems that neither a packaged app nor an extension can achieve both these things, so I'm now considering trying to achieve what I'm after with a separate packaged app and extension communicating.
I see that Chrome's documentation explains how two extensions can communicate via chrome.runtime.onMessageExternal.addListener and chrome.runtime.sendMessage, but nothing about packaged apps and extensions communicating.
Does anyone know if this is allowed? Is there any documentation, or a working example out there?
Yes, that is possible. The code sample in the documentation you linked works for any combination of app and extension.
The extension documentation for chrome.runtime.sendMessage says:
Sends a single message to onMessage event listeners within the extension (or another extension/app).
Messaging works the same in both extensions and apps, and they seem to be fully compatible; simply use the ID for the destination extension or app. If you look at the docs for the app version of chrome.runtime.sendMessage, you'll see that it is identical to the extension version.
From the command line, I can open a url as a chrome application by running e.g.
chromium --app=https://www.stackoverflow.com
Is it possible to do open a url in this mode from javascript in an existing page? To be clear, the url should ideally be opened in a new window, which has the properties implied by the --app flag (e.g. no address bar), whether or not the current page is running in that mode.
My reason for asking is that I'd like to integrate this into vimium.
There is no way to do what you need directly from Javascript. I think you'll need to create an Chrome extension to do that.
You still can find an extension called "Open with external application" which do that, but its use NPAPI and NPAPI is not supported anymore by latest Chrome version. The source is hosted on BitBucket.
The new way to do the same thing is using the native messaging API. In this case the external application would have to register a native messaging host in order to exchange messages with your application. You can see more at http://developer.chrome.com/extensions/messaging.html#native-messaging
I have an extension
https://chrome.google.com/webstore/detail/myextenstion/lkdklkkflkfedlbfpl
like this.
i created a menu item on my website like
Click here to Download Extesnion
which is working fine'
Now i want user just click and extension popup appear directly .
Any idea ?
Thanks
Before Chrome 33 on windows, you could self-host your crx file and serve it with a given content-type to trigger the installation popup.
See https://developer.chrome.com/extensions/hosting
Since them, to avoid malware, users can only install extensions hosted on the chrome web store (if they don't use the "developer mode" settings in chrome).
To install from a third party website directly, chrome provides a javascript API (called inline installation).
Here is the documentation
https://developer.chrome.com/webstore/inline_installation
I'm looking for a way to open a Chrome extension from URL, in HTML and Javascript.
Something like redirect to chrome://<extension-id> (which doesn't work on the last version of Chrome).
Is it possible?
Can I retrieve all the extensions installed on Chrome (user side)?
In this case I would be able to get the ID of the application, if needed.
I've just solved in this way:
window.location = chrome.extension.getURL('index.html');
As I'm developing a Chrome extension, this code automatically redirect to the main page of the extension (it requires a proper manifest.json file).