By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

Getting Unix login name or home dir from client-side JavaScript

P: n/a
Is there any way at all I can get a user's login name from within
JavaScript on Unix/Linux with Mozilla browser. If not, how about the
home directory? I know there are *usually* variables accessible via
navigator.preferences() that contain the info, but I have found none
that can *always* be expected to exist.

- Toralf

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Toralf Lund wrote:
Is there any way at all I can get a user's login name from within
JavaScript on Unix/Linux with Mozilla browser. If not, how about the
home directory? I know there are *usually* variables accessible via
navigator.preferences() that contain the info, but I have found none
that can *always* be expected to exist.

- Toralf


You have no access to that information in client-side JavaScript in the
default security environment.

Signed scripts can access window.navigator.preference() on Netscape 4,
but there does not appear to be anything like that on Mozilla: <url:
http://www.mozilla.org/docs/dom/domr...f.html#1004028 /> or
IE: <url:
http://msdn.microsoft.com/workshop/a..._navigator.asp
/>.

Even in Netscape 4, the list of things you can get from
window.navigator.preference() is fairly limited: <url:
http://devedge.netscape.com/library/...v.html#1194000
/>. The list doesn't seem to include the current OS user or the home
directory path.
--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.