0

I am trying to calling exe from chrome extension. I googled and come to know that It is possible from NPAPI plugins only. I also got the impression that it can be write only in c /c++ (which i dont know.). Can anybody help me on NPAPI plugins.

If its possible to build in visual studio using c# or vb.net.

Manifest.Json file

{
"name": "My First Extension",
"version": "1.0",
"manifest_version": 2,

"description": "The first extension that I made.",
"browser_action": {
                  "default_icon": "icon.png",
                  "default_popup": "MyPage.html"
                 },
"permissions": [
                "MyPage.html"
               ]
}

MyPage.html file

<html> 
   <head>
       <script src="my.js"></script>
       <script language="JavaScript" type="text/javascript" > </script> 
   </head> 
          <body>  
          </body> 
</html> 

my.js file

window.onload = function()
    {
       RunExe();
    }; 
function RunExe()   
    { 
     MyObject = new ActiveXObject( "WScript.Shell" ) 
     MyObject.run     ("file:///C:/Users/manoj.gangwar/Desktop/FormEx_Sample_Project/TestProject/bin/Debug/TestForm.exe"); 
     window.close();           
    }   

Thanks and Regards Manoj

Stan
  • 8,683
  • 9
  • 58
  • 102
Manoj G
  • 87
  • 14
  • Have you tried http://stackoverflow.com/questions/4546124/ready-to-use-npapi-plugin-to-launch-external-application?rq=1 – Sudarshan Nov 22 '12 at 08:27

1 Answers1

1

No, there is no way to create a browser plugin in .net without knowing C++. It might be possible to make something in C++ that would act as a bridge to allow .net assemblies to behave as a plugin, but to the best of my knowledge nobody has created such a thing.

taxilian
  • 14,229
  • 4
  • 34
  • 73
  • there might be some tool or platform by which i can get template easily. and my doing some modification I can acheive my requirement. – Manoj G Nov 22 '12 at 21:00
  • Oh boy I sure hope not. Do you have any idea how dangerous that would be? All it would take is a tiny mistake and you'd expose the API to the web page and suddenly an attacker can use it to launch arbitrary executables on any computer. tread very carefully here, plugins and extensions like yours are the reason the rest of us have to put up with so many restrictions. – taxilian Nov 23 '12 at 00:46