Connecting Tech Pros Worldwide Help | Site Map

Signed Javascript in IE

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 3rd, 2005, 09:15 AM
FatBo
Guest
 
Posts: n/a
Default 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


  #2  
Old November 3rd, 2005, 10:35 AM
VK
Guest
 
Posts: n/a
Default Re: Signed Javascript in IE


FatBo wrote:[color=blue]
> 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?[/color]

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?

  #3  
Old November 3rd, 2005, 10:45 AM
Randy Webb
Guest
 
Posts: n/a
Default Re: Signed Javascript in IE

FatBo said the following on 11/3/2005 5:05 AM:
[color=blue]
> Dear all,
>
> I am writing a Javascript which print a page without prompting the
> print dialog when the page is loaded.[/color]

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.
[color=blue]
> However, there is a warning box prompted out because I am requesting
> the privilege of client's computer.[/color]

Yes, thats how most ActiveX components that are trying to go outside the
security boundaries get handled.

[color=blue]
> 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.[/color]

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?
[color=blue]
> I am using the code to bypass the print dialog:
> <script>
> function Print()
> {
> if (document.all)
> {
> if (confirm("Print now?"))
> {[/color]

Just because the browser supports/passes the document.all test does not
mean it supports WebBrowser1.ExecWB or .outerHTML
[color=blue]
> 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?[/color]

I hope not.

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

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.