I need to create an extension for Google Chrome that runs a . exe or something similar

Asked

Viewed 1,248 times

3

I need to make my Website run a local system (your .exe), passing some attributes by the executable, I want to do an extension to Google Chrome that I can pass the parameters to run the program. How do I do that? If it’s not possible, you can do something similar?

  • This is me smelling viruses in users' micro hein, Chrome extension that run a . exe rs

  • I need to pass the information of the sale to carry out the SAT CF-e broadcast by the desktop system.

  • Have you started to develop something? Already have some code ready? doubt itself is programming or a strategy of how to do it?

  • I have a desktop emitter, it receives parameters by your exe file at the time of execution to open and perform the emission, but as I am developing a web application, I need to pass this information from the browser to the emitter and run it for it to perform the emission

  • 1

    This is typically done server-side: its extension would make a request to a server, instructing it to do the issue

2 answers

3

This is not possible, there is no way around it as it is intentional that it is not possible (for safety reasons) to fire an executable

What you can do is try to recreate yours. exe as a Webextension or as a Chromeapp, in the case of Chromeapp you can call it by the first extension using https://developer.chrome.com/extensions/runtime#method-connectNative

It was possible to use earlier NPAPI to load dlls, but the NPAPI has been removed.

However note that it is possible to use NPAPI to load Dlls for example:

The manifest.json should look like this:

{
  "name": "My extension",
  ...
  "plugins": [
    { "path": "extension_plugin.dll" }
  ],
  ...
}

The use should be something like:

<embed type="application/x-my-extension" id="pluginId">
<script>
  var plugin = document.getElementById("pluginId");
  var result = plugin.myPluginMethod();  // call a method in your plugin
  console.log("my plugin returned: " + result);
</script>

  • NPAPI was permanently removed from Chrome in September 2015 https://support.google.com/chrome/answer/6213033?hl=pt-BR

  • @well remembered rodorgas, edited

-2

One idea is to provide an additional installer (a windows service for example) that opens an http communication port, and you communicate directly with it via localhost.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.