473,486 Members | 1,640 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Signed Javascript in IE

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 signing the
javascript can solve the problem or not.

I am using the code to bypass the print dialog:
<script>
function Print()
{
if (document.all)
{
if (confirm("Print now?"))
{
WebBrowser1.ExecWB(6, 6) //use 6, 1 to prompt the print
dialog or 6, 6 to omit it;
WebBrowser1.outerHTML = "";
//alert("print now");
}
}
else
{
window.print();
}
}
</script>

Since the ExecWB(6,6) activeX control is not written by me so I cannot
sign it. But can I get the same result if I can sign the javascript?

Thank you everyone !!
FatBo

Nov 3 '05 #1
2 6111
VK

FatBo wrote:
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 signing the
javascript can solve the problem or not.

I am using the code to bypass the print dialog:
<script>
function Print()
{
if (document.all)
{
if (confirm("Print now?"))
{
WebBrowser1.ExecWB(6, 6) //use 6, 1 to prompt the print
dialog or 6, 6 to omit it;
WebBrowser1.outerHTML = "";
//alert("print now");
}
}
else
{
window.print();
}
}
</script>

Since the ExecWB(6,6) activeX control is not written by me so I cannot
sign it. But can I get the same result if I can sign the javascript?


Microsoft doesn't have "Signed client-side JScript" concept as such,
it's the Netscape > FireFox way.
You can write an ActiveX control on any "real" language you have handy
right now and install it on each machine of question.
If your boss is able to cough up US$400, your customers can also
install properly signed ActiveX upon need (the security dialog will be
shown then only once during the initial installation).
Also it it's an intranet why not send printjob request to the server to
print it on the network printer?

Nov 3 '05 #2
FatBo said the following on 11/3/2005 5:05 AM:
Dear all,

I am writing a Javascript which print a page without prompting the
print dialog when the page is loaded.
Why? People are accustomed to seeing that dialog box. I typically use it
to Preview the page before Printing, just to make sure I get what I want.
However, there is a warning box prompted out because I am requesting
the privilege of client's computer.
Yes, thats how most ActiveX components that are trying to go outside the
security boundaries get handled.

But my boss doesn't want to lower the security settings and
doesn't want to see the prompt dialog. I am wonder that signing the
javascript can solve the problem or not.
No. But what does your "boss" think about people that use browsers that
do not support the ActiveX and document.all and get the dialog from the
else{window.print()} of your function?
I am using the code to bypass the print dialog:
<script>
function Print()
{
if (document.all)
{
if (confirm("Print now?"))
{
Just because the browser supports/passes the document.all test does not
mean it supports WebBrowser1.ExecWB or .outerHTML
WebBrowser1.ExecWB(6, 6) //use 6, 1 to prompt the print
dialog or 6, 6 to omit it;
WebBrowser1.outerHTML = "";
//alert("print now");
}
}
else
{
window.print();
}
}
</script>

Since the ExecWB(6,6) activeX control is not written by me so I cannot
sign it. But can I get the same result if I can sign the javascript?


I hope not.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 3 '05 #3

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

Similar topics

2
1760
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. ...
12
8465
by: Andrey | last post by:
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....
11
1642
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
3276
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...
1
1493
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:...
1
1447
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"...
3
2995
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...
2
3857
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: ...
0
7094
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,...
0
6964
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...
0
7123
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,...
0
7173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7305
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...
1
4863
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...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
259
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...

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.