Introduction
User JavaScript allows you to specify local JavaScript files for Opera to include on every page that you visit.
User JavaScript can be used for many purposes, including:
- Fixing broken scripts on Web pages
- Enhancing Web pages by changing or adding your own content to the page
- Controlling what scripts are allowed to run on a page, and what they are allowed to do
- Simplifying bookmarklets by adding functions they depend on to the User JavaScript
This tutorial was last updated for Opera 9.0.
Table of contents
Utilizing User JavaScript
Examples of use
- Overriding specific variables or functions
- Loading scripts
- Overriding events and event handlers
- JavaScript URLs
- Normal scripts and events
- Greasemonkey scripts
- Controlling navigation mode
User JavaScript specifications
Security
It is possible to share User JavaScript files created by others, but you should never install and use a script library from someone you do not know and trust. If in doubt, post the script in the Opera forums, newsgroups, or mailing lists, and ask if the script you would like to use is well written and exploit-free.
If enabled, User JavaScript will be loaded on most pages that you visit, including pages in any frames and inline frames. Any global functions and variables created in the User JavaScript will be available, and can be read by any scripts on these pages. For this reason, to protect your privacy and security, we recommend that you do not include any sensitive information in your User JavaScript. By default, User JavaScript will not be loaded on secure pages.
To check if User JavaScript is enabled, see or opera:about. If User JavaScript is enabled, the location of the User JavaScript files will be shown as the "User JavaScript files" listed under "Paths".
Note: User JavaScript will not be loaded on pages accessed using the opera: protocol.
Support search
Search our knowledge base:
