Privileged versus non-privileged context
Some JavaScript methods, marked by an S in the third column of the quick bar, have security restrictions. These methods can be executed only in a privileged context, which includes console, batch and application initialization events. All other events (for example, page open and mouse-up events) are considered non-privileged.
The description of each security-restricted method indicates the events during which the method can be executed.
Beginning with Acrobat 6.0, security-restricted methods can execute without restrictions if the document certifier’s certificate is trusted for running embedded high privilege JavaScript.
In Acrobat versions earlier than 7.0, menu events were considered privileged contexts. Beginning with Acrobat 7.0, execution of JavaScript through a menu event is no longer privileged. You can execute security-restricted methods through menu events in one of the following ways:
-
By opening the JavaScript category of the Acrobat preferences and checking the item named “Enable Menu Items JavaScript Execution Privileges”.
-
By executing a specific method through a trusted function (introduced in Acrobat 7.0). Trusted functions allow privileged code—code that normally requires a privileged context to execute—to execute in a non-privileged context. For details and examples, see app.trustedFunction.