0

I am creating a chrome application that needs to open a local file that the user specifies, and this file will need to be opened in which ever browser they so choose. Now with the chrome application I have already thought of the conditional for when they are on a chromebook, so that set aside.

I have some possibilities of file locations for the exe of each browser. here are mine

Chrome Locations

    C:\Program Files (x86)\Google\Chrome\Application

Firefox Locations
    C:\Program Files (x86)\Mozilla Firefox

IE Locations
    C:\Program Files (x86)\Internet Explorer

Edge Locations
    C:\Windows\SystemApps\Microsoft.MicrosoftEdge_------- (not sure if the end is a key so removed)

So basically I was thinking maybe using a PNaCl or a NaCl for Google's Native Client to use C++ and using ShellExecute except I'm not sure how to combine the file location and the browser the user specifies.

They want to open Microsoft Edge and run index.html

void main()
{  
    ShellExecute(NULL, "open", "C:\Windows\SystemApps\Microsoft.MicrosoftEdge_-------",
                 NULL, NULL, SW_SHOWNORMAL);
}

Seems as though Google allows it in the Manifest so here is the example

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

So really how to write a clean dll file to execute file location and browser locations. And then again reading further I get this,

Marking your NPAPI plugin "public" increase the attack surface of your extension because the plugin is exposed directly to web content, making it easier for a malicious web site to manipulate your plugin. Instead, avoid making your NPAPI plugin public whenever possible.

Which I don't want anyone feeling disgruntled over something that could be malicious, I just need it to run a local browser, also maybe find the file locations easier than checking for every possible locations. Thanks in advanced.

Question repeated in case you got lost.

  1. Running a NPAPI dll program
  2. How to use ShellExecute or a function to run the browser of choice and file determined by the user
  3. Understanding if NPAPI will hurt my users if it is just for them no one else.
EasyBB
  • 6,176
  • 9
  • 47
  • 77
  • possible duplicate of [NPAPI support in Firefox and Chrome actually droped?](http://stackoverflow.com/questions/19457786/npapi-support-in-firefox-and-chrome-actually-droped) – durron597 Sep 05 '15 at 17:20

1 Answers1

1

You missed an important link at the top of the NPAPI page you quoted from; it's no longer possible to publish extensions than use NPAPI, and the next release will remove all NPAPI support. If you want to communicate with native applications, you'll need to use Native Messaging as a bridge (see other questions about launching applications from Chrome for details).

As for NaCl, it does not allow you to call arbitrary Windows APIs.

smorgan
  • 20,228
  • 3
  • 47
  • 55
  • Ok so native messaging is what I have to use, does it install the special Json for permissions of nm within the chrome application or is that a separate install? Documentation is very vague – EasyBB Aug 06 '15 at 13:48