473,553 Members | 2,945 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Signed javascript?

Hi,

I just wonder if anybody can help me with this:
I need to give my javascript code some extended permissions for disk access on client's machine,
and as i understand i need to sign this js. Can someone tell me how to sign js to work with with ie?
Can i put my js file into jar and use jarsigner for that?
And by the way, would it give me disk access permissions?

I need that for the following: our client gets a cd from us with some mp3 files. When they log onto
our web site, they see some links:
eg <a href="file:///e:/resource/file.mp3"><a/>

pointing to the files in their cd, so when they click on a link, that file should start playing.

Or is there another way to access client's disk from a web page for a task like described?

I would highly appreciate any ideas/suggestions!

Thank you in advance!
Andrey
Jul 23 '05 #1
12 8475
On Wed, 06 Oct 2004 14:48:06 GMT, Andrey wrote:
Can i put my js file into jar and use jarsigner for that?


You can put Java classes into a jar and use Sun's jar signing
tool to give it extended privileges, but that will not work
with *Javascript*.
<http://www.physci.org/codes/javafaq.jsp#js>

Figure out exactly what you are dealing with before you proceed.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
Jul 23 '05 #2
Andrew Thompson wrote:

<snip>
You can put Java classes into a jar and use Sun's jar signing
tool to give it extended privileges, but that will not work
with *Javascript*.
<http://www.physci.org/codes/javafaq.jsp#js>

Figure out exactly what you are dealing with before you proceed.


That post seemed perfectly on-topic to me. The OP was obviously asking
whether JavaScript can be put into a jar file and signed, just like Java
can.

At least, I imagine that by "js file" it was meant "file with a .js
extension"....

Stewart.
Jul 23 '05 #3
Andrew Thompson wrote:
On Wed, 06 Oct 2004 14:48:06 GMT, Andrey wrote:

Can i put my js file into jar and use jarsigner for that?

You can put Java classes into a jar and use Sun's jar signing
tool to give it extended privileges, but that will not work
with *Javascript*.
<http://www.physci.org/codes/javafaq.jsp#js>

Figure out exactly what you are dealing with before you proceed.

Andrew, my question is about JavaScript, not Java.
Maybe it confused you when i asked about signing jar file, but i've seen something on the internet
about calling javascript from a signed jar - yes, just client-side javascript code, not a Java
applet or anything else.

Ok, here's my problem - say i have a bunch of links on my web page and i need to show/hide them
depending on what files present on client's machine - so i want to do it using JavaScript/DHTML.

But to access client's resources(eg CD-ROM), i need to get special permissions, right?
So my question is if JavaScript code can be signed to get access to client's resources?

I've seen in a js book that UniversalBrowse rRead (or something like that) permissions are required,
so my question is how do i do that?
Thank you in advance,
Andrey

Jul 23 '05 #4
Stewart Gordon wrote:
Andrew Thompson wrote:

<snip>
You can put Java classes into a jar and use Sun's jar signing tool to
give it extended privileges, but that will not work with *Javascript*.
<http://www.physci.org/codes/javafaq.jsp#js>

Figure out exactly what you are dealing with before you proceed.

That post seemed perfectly on-topic to me. The OP was obviously asking
whether JavaScript can be put into a jar file and signed, just like Java
can.


You are right :) But more generally i've asked if there is a way to enable javascript access to a
local resource (hard-drive or cd-rom)

Do you know anything about this?

At least, I imagine that by "js file" it was meant "file with a .js
extension"....

That's perfectly true :)

Thank you
Andrey
Jul 23 '05 #5
"Andrey" <le*******@yaho o.com> wrote in message
news:WpU8d.3415 09$Fg5.329447@a ttbi_s53...
Andrew Thompson wrote:
On Wed, 06 Oct 2004 14:48:06 GMT, Andrey wrote:

Can i put my js file into jar and use jarsigner for that?

You can put Java classes into a jar and use Sun's jar signing
tool to give it extended privileges, but that will not work
with *Javascript*.
<http://www.physci.org/codes/javafaq.jsp#js>

Figure out exactly what you are dealing with before you proceed.

Andrew, my question is about JavaScript, not Java.
Maybe it confused you when i asked about signing jar file, but i've seen

something on the internet about calling javascript from a signed jar - yes, just client-side javascript code, not a Java applet or anything else.

Ok, here's my problem - say i have a bunch of links on my web page and i need to show/hide them depending on what files present on client's machine - so i want to do it using JavaScript/DHTML.
But to access client's resources(eg CD-ROM), i need to get special permissions, right? So my question is if JavaScript code can be signed to get access to client's resources?
I've seen in a js book that UniversalBrowse rRead (or something like that) permissions are required, so my question is how do i do that?
Thank you in advance,
Andrey


Perhaps a modification of the following?

<html>
<head>
<title>if_file. htm</title>
</head>
<body>
<script type="text/javascript">
var wNT = "C:\\WinNT\\sys tem.ini";
var w98 = "C:\\Windows\\s ystem.ini";
var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
if (oFSO.FileExist s(wNT)) alert(wNT);
if (oFSO.FileExist s(w98)) alert(w98);
</script>
</body>
</html>
Jul 23 '05 #6
McKirahan wrote:

<...>

Perhaps a modification of the following?

<html>
<head>
<title>if_file. htm</title>
</head>
<body>
<script type="text/javascript">
var wNT = "C:\\WinNT\\sys tem.ini";
var w98 = "C:\\Windows\\s ystem.ini";
var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
if (oFSO.FileExist s(wNT)) alert(wNT);
if (oFSO.FileExist s(w98)) alert(w98);
</script>
</body>
</html>


Right, that's exactly what i want to do, but the problem that IE will not allow to run this script
on client machine because of security issues.
So i need to make this javascript 'trusted', and that's my question - how?

Thank you,
Andrey
Jul 23 '05 #7
VK
Signed JavaScript technology (.js in .jar) has been implemented in 4th
Netscapes and died with them. Starting 5th version (AKA 6th) they dropped
it. IE never supported it. Also even then you would not get the disc access,
it was all for "little" privileges: chromeless windows, off-screen
positioning etc.

You may start with a simple BlahBlah.hta page
If user grants permission on request, you can create an FileObject and go
on.

Also put a complain form on the same page ("My X browser doesn't work, what
a hell?")
If you collect at least 40-50 nasty ones, you may consider to buy a code
signing cert and mess up with signed applets/ActiveX. Up to that point HTA
would be sufficient.
:-)
:-|
Jul 23 '05 #8
"Andrey" <le*******@yaho o.com> wrote in message
news:M9V8d.1909 98$MQ5.20101@at tbi_s52...
Right, that's exactly what i want to do, but the problem that IE will not allow to run this script on client machine because of security issues.
So i need to make this javascript 'trusted', and that's my question - how?

Thank you,
Andrey


As VK suggested, try an HTA (HTML Application):

<html>
<head>
<title>if_file. hta</title>
</head>
<body>
<script type="text/javascript">
var wNT = "C:\\WinNT\\sys tem.ini";
var w98 = "C:\\Windows\\s ystem.ini";
var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
if (oFSO.FileExist s(wNT)) alert(wNT);
if (oFSO.FileExist s(w98)) alert(w98);
</script>
</body>
</html>
Jul 23 '05 #9
McKirahan wrote:
"Andrey" <le*******@yaho o.com> wrote in message
news:M9V8d.1909 98$MQ5.20101@at tbi_s52...
Right, that's exactly what i want to do, but the problem that IE will not


allow to run this script
on client machine because of security issues.
So i need to make this javascript 'trusted', and that's my question - how?

Thank you,
Andrey

As VK suggested, try an HTA (HTML Application):

<html>
<head>
<title>if_file. hta</title>
</head>
<body>
<script type="text/javascript">
var wNT = "C:\\WinNT\\sys tem.ini";
var w98 = "C:\\Windows\\s ystem.ini";
var oFSO = new ActiveXObject(" Scripting.FileS ystemObject");
if (oFSO.FileExist s(wNT)) alert(wNT);
if (oFSO.FileExist s(w98)) alert(w98);
</script>
</body>
</html>


Ok, it's closer. But if i launch this hta file, it pops a new blank window after the alert is ok'd.
But i need to integrate this into my existing web site, with no additional windows to popup.
Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1770
by: LC's No-Spam Newsreading account | last post by:
I asked a couple of days ago about the following arrangement (simplified). I made some progress using netscape.security.PrivilegeManager.enablePrivilege but still have to ask some further help. 1) a frameset contains - a number of javascript functions in the head (they do something like top.frames.document.myform.elements.value = v - two...
2
6116
by: FatBo | last post by:
Dear all, I am writing a Javascript which print a page without prompting the print dialog when the page is loaded. However, there is a warning box prompted out because I am requesting the privilege of client's computer. But my boss doesn't want to lower the security settings and doesn't want to see the prompt dialog. I am wonder that...
11
1651
by: chanma | last post by:
I have an num -569360386, and turn it into hex format. I use toString(16),I get -21efc002. But how can get 0xDE103FFE,which is to ignore the highest bit as the signed bit?
10
3284
by: =?iso-8859-2?B?SmFuIFJpbmdvuQ==?= | last post by:
Hello everybody, this is my first post to a newsgroup at all. I would like to get some feedback on one proposal I am thinking about: --- begin of proposal --- Proposal to add signed/unsigned modifier to class declarations to next revision of C++ programming language
1
1498
by: jindalily | last post by:
Hey guys, I wasn't completely sure if this would be a Java or JS topic, but I thought it had more to do with Ajax and whatnot. Anyway, I have an embedded and signed Java applet on my page like so: <applet style="position:absolute;left:-1px" code="fileSaver.class" archive="SignedFileSaver.jar" width="1" height="1"></applet> this applet's...
1
1452
by: lavie | last post by:
I have a signed JAR which contains an HTML page and a .JS file full of various Javascripts. I am attempting to call some of the JS from the HTML. I have tried both <script src="DnDTest.js" language=javascript></script> and <script src="jar://localhost/output.jar!/DnDTest.js" language=javascript></script>, but it still doesn't recognize the JS...
3
3001
by: hello2008 | last post by:
Hi, I donot have much knowledge of R.Exp. In my web page I am required to validate numeric textboxes allowing signed/unsigned integer/float numbers and then compare between them. I need the textboxes to accept values only between -10 to +10. Please help? Below is my code <html> <head> <title> Display Requirements </title>
2
3869
by: JohnLorac | last post by:
Hello, I'm trying to load and write file on local disc drive using signed javascript file. But I have experienced problem running this url: jar:http://www.domain.com/secure-scripts/secure.jar!/thepage.html (sample) in browser (Firefox) which simply won't work. I can't access to html file embedded in jar file. My sample applet IO.java...
0
7568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7492
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7772
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7852
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6109
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5409
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1990
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
808
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.