Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript: Can you read the systems volume?

Is there any way to read the System's (Linux, Windows, OS/X etc) volume with Javascript?

I don't need to set it, just read it?

thanks

like image 690
Matt Avatar asked Mar 20 '11 12:03

Matt


1 Answers

I'm assuming you're talking about Javascript in a browser environment. In this case, the answer is clear, short and simple: No.

Clientside Javascript has no support for File IO operations.


However, in some browsers you can breach that rule by setting browser specific options. For instance, calling a Webkit based browser with the command-line argument --disable-web-security allows the browser to read a uri like file:///c/somefolder/. Mozilla offers this possibilty by editing the user ini plus a setting in about:config.


Update

I guess deceze's comment is correct and you really mean the "sound volume". In that case you can forget about the above text, but the answer is again no. There is no native Javascript interface to get and/or set that kind of OS setting.

like image 72
jAndy Avatar answered Oct 04 '22 11:10

jAndy