2

What is the best way to execute a command on the client computer via the web browser?

I know a Java applet is one way, but I really don't want to use Java.

Will a firefox plugin work?

sanbornm
  • 187
  • 1
  • 7
  • 2
    The whole concept of web browser security is against you here, could you elaborate a bit on what you exactly want to do. – Esko Oct 24 '09 at 18:14
  • I am trying to send raw printer codes to the printer. As the printer in question is a thermal printer that accepts its own set of printer codes. i.e. it doesn't use postscript. – sanbornm Oct 24 '09 at 18:28
  • 1
    Please edit your question to indicate all additional knowledge of your situation you can think of. Fixed hw/sw platform? Fixed printer? User attending or stand alone application? – Thorbjørn Ravn Andersen Oct 24 '09 at 19:30
  • 1
    I assume you are doing that for an intranet application, since those thermal printers are nothing you can expect on a normal web user's PC. So: I think you are going a completely wrong way. Just let the server directly connect to the printers through the network (SMB), no need to let it run through the browser. – Erich Kitzmueller Oct 24 '09 at 19:49
  • don't you have a printer driver that already allows the generic browser print commands to be converted and sent to the printer? – djangofan Nov 06 '09 at 18:16

4 Answers4

1

You can do that in an extension (much easer to make than a plugin).

That's done with nsIProcess: https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIProcess

erwan
  • 1,285
  • 5
  • 14
  • 28
0

Yes, a firefox plugin will do it since plugins (in contrast to extensions) have the same access rights on the computer the user has.

If you want, you can have a look at my SuperUser-Question: Java Plugin a huge security risk? How to preseve Java plugin from privilege escalation? but you don't seem to want to use Java ;-).

Community
  • 1
  • 1
Johannes Weiss
  • 52,533
  • 16
  • 102
  • 136
0

For Windows, you might be able to just share the printer and access the printer queue remotely.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

Why not just use a relevant content type for the printer command files and configure the browsers to to the right thing with such files? Since you are talking about special binary files for special thermal printers, I assume you are talking about a limited set of browsers ...

Rasmus Kaj
  • 4,224
  • 1
  • 20
  • 23