开发者

Use serial port in web environment

I need to use serial port in client side of web based application. which solution suggested for using serial port in web browser. can Firefox addon开发者_运维技巧 use serial port or call dll function? which other solution?


You'll have to write add ons to make this work.

For Internet Explorer; you can write a Browser Helper Object(BHO).

For Firefox, Chrome, and Safari; I think your only option is to write a Netscape Plugin using NPAPI. FireBreath is a very useful framework for building these kinds of plugins as it takes care of a lot of the dirty work for you, allowing you to focus on the plugin itself. This will let you knock out those three with one stone - you can also write it to be cross platform (support many operating systems) if you desire. Each of those browsers have their own extension models as well that can be written in pure JavaScript; but they don't expose a serial port API due to lack of need and security concerns; making NPAPI the only viable solution.


However, all that said, I would question whether or not you should be doing this in a browser at all. This sounds more like a client application, to me.

You have a few other options depending on your needs. If you are writing specifically for the Windows platform, many have found that they can use Silverlight 4 Out-of-Browser plus an Active-X object for serial port access (Silverlight does not have a native API for serial port access). This won't work in the browser; but it's an option to consider.


Consider a lightweight client application which implements the websocket protocol.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜