# Java and JavaScript

## &Java; and JavaScript

### &Java;

&Java; allows applications to be downloaded and run by a web browser, provided you have the necessary software installed on your machine. Many web sites make use of &Java; (for example, online banking services or interactive gaming sites). You should be aware that running programs from unknown sources could pose a threat to the security of your computer, even if the potential extent of the damage is not great.

The check box Enable Java globally allows you to turn &Java; support on for all web sites by default. You can also select to turn &Java; on or off for specific hosts. To add a policy for a specific host, click the New... button to bring up a dialog in which you can type the host name and then choose to accept or reject &Java; code from that particular host, which will add the domain to the list on the left of the page.

You can select a host in the list, and click the Change... button to choose a different policy for that host. Clicking the Delete button removes the policy for the selected host; after deletion, the global settings will then apply to that host.

Finally, the group of controls labeled Java Runtime Settings allows you to set some options for the way in which &Java; should run.

Use security manager is normally enabled by default. This setting will cause the JVM to run with a Security Manager in place. This will keep applets from being able to read and write to your file system, creating arbitrary sockets, and other actions which could be used to compromise your system. Disable this option at your own risk. You can modify your `$`HOME`/.java.policy` file with the &Java; policytool utility to give code downloaded from certain sites more permissions.

Use KIO will cause the JVMto use &kde;'s own KIO transports for network connections.

The Shutdown applet server when inactive for more than check box allows you to save resources by closing the &Java; Applet Server when it is not in use, rather than leaving it running in the background. Leaving this disabled may make &Java; applets start up faster, but it will use system resources when you are not using a &Java; applet. If you enable this, you can set a timeout.

You can either opt to have &konqueror; automatically detect the &Java; installation on your system, or specify the path to the installation yourself by selecting Path to Java executable or 'java'. You may want to choose the latter method, for instance, if you have multiple &Java; installations on your system, and want to specify which one to use. If the &Java; Virtual Machine you are using requires any special startup options, you can type them in the text box labeled Additional Java arguments.

### JavaScript

Despite the name, JavaScript is not related at all to &Java;.

The first part of this tab works the same as the &Java; settings.

The checkbox Enable JavaScript globally allows you to turn JavaScript support on for all web sites by default. You can also select to turn JavaScript on or off for specific hosts. To add a policy for a specific host, click the New... button to bring up a dialog in which you can type the host name and then choose to accept or reject JavaScript code from that particular host, which will add the domain to the list on the left of the page.

You can select a host in the list, and click the Change... button to choose a different policy for that host. Clicking the Delete button removes the policy for the selected host; after deletion, the global settings will then apply to that host.

The final set of options in the section Global JavaScript Policies determine what happens when a page uses JavaScript for specific actions.

You can individually enable or disable the ability of JavaScript to manipulate your windows by moving, resizing or changing focus. You can also disable JavaScript from changing the status bar text, so that for instance, you can always see where links will take you when clicked. The choices for these options are Allow and Ignore.

For opening a new window, there is even more control. You can set &konqueror; to Allow all such requests, Ask each time a request is made, or Deny all popup requests.

The Smart setting will only allow JavaScript popup windows when you have explicitly chosen a link that creates one.