I need to use firefox and I need to interface my web page with a USB Check Scanner. Can I write a plugin or extension that allows me to interface with a dll written in C#? I prefer not to use COM or ActiveX.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Due to the security of web browsers I don’t think it’s possible with javascript even if the site is considered a trusted site. By design browsers don’t allow any code to access hardwire such as disks or usb scanners. I think you are going to have to go the ActiveX route if need access to local hardware on the machine viewing the webpage.
–Added
Some others have mentioned silverlight and the plugin for firefox that allows xbap’s to run. Silverlight won’t work as it has the same restrictions as the browser. It lives in the sandbox and cannot access any resources locally other than being able to read and write to IsolatedStorageFile (basically a large cookie file where the application is run). Unless you can get it to run in Full Trust.
WPF/xbap also has the same security restrictictions when running in a browser. You can however sign the xbap application and go through some hoops to get the xbap to run in a Full Trust Environment…requires trusting or installing certificates on the client machine.
In order to get access to the usb scanner you’re going to need something that elevates your code to full trust. The xbap is possibility but I think you’ll find it much easier to go the ActiveX route if you need those kind of permissions.
Alternatively you could create a Windows Forms application. Inside of it you could put a Broswer Control that goes to your website. Your forms application will have permission to access the usb scanner c#.dll assuming the dll is in the same directory as your windows forms…if not you may need to run the forms application with Administrator rights.