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.
- Running a NPAPI dll program
- How to use ShellExecute or a function to run the browser of choice and file determined by the user
- Understanding if NPAPI will hurt my users if it is just for them no one else.