Copy link to clipboard
Copied
Hi guys, I have tried these examples (Example 1 , Example 2 ) and create a trusted function in folder level script to surpass the default warning message in the app.alert() with another alert title. However, the trusted function seems like not working in the distributed version of my pdf form. As i know, this will only work if the trusted function has been installed on the user's system but will error out when not installed. How can I solve this problem?
Copy link to clipboard
Copied
What is the problem, exactly?
Copy link to clipboard
Copied
I don't want the default alert message title ("Warning: Javascript Window"), it is misleading for consumer when filling the form.
Copy link to clipboard
Copied
But you know the answer already... In order to do that you have to run the script from a privileged context, such as a trusted function that's installed on the local machine.
Copy link to clipboard
Copied
You can't, by design. This is a crucial security feature.
Copy link to clipboard
Copied
Any documentation on this security feature?
Copy link to clipboard
Copied
Yes, it's documented in the JavaScript for Acrobat API Reference document (although the way it's worded is somewhat outdated). For example:
Copy link to clipboard
Copied
It's a standard JavaScript feature, not just in Acrobat. It's considered vital since web pages and PDFs are uncontrolled downloads, and they COULD come from a bad source. All PDFs and web pages are therefore penalised because it's the only way to penalise the bad ones.
It is about impersonation/phishing. It makes it impossible to produce a message which looks exactly like a legitimate system message. For example, a box which looks exactly like a Facebook login; many people would fall for it and the PDF/web page now has their password. Instead of getting rid of this, I'd suggest focussing on treating it as part of mandatory security training for your users. They should be recognising and celebrating it, not wanting it to go away...
Copy link to clipboard
Copied
You can check the existence of the function.
Copy link to clipboard
Copied
can u explain more?
Copy link to clipboard
Copied
When the trusted function doesn't exists use the app.alert()