Browser related methods in JavaScript
| A A | Font size |
|
Moving and resizing the browser window:
Navigator methods:
ClipboardData methods:
UserProfile methods:
External methods:
Opera object methods:
Utility methods:
History methods:
Component methods:
Plugin methods:
Cryptographic methods:
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| moveBy (window) |
Moves the browser window by the specified number of pixels, relative to its current coordinates. | ||||||
| moveTo (window) |
Moves the top-left corner of the browser window to the specified position, relative the top-left corner of the screen. | ||||||
| resizeBy (window) |
Resizes the browser window by the specified amount of pixels, relative to its current size. | ||||||
| resizeTo (window) |
Resizes the browser window to the specified size. |
| Method | Support | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| isSupported |
|
Returns whether the specified DOM module and version is supported by the current node. | ||||||||||
| javaEnabled (clientInformation, navigator) |
Returns a Boolean value that indicates whether Java is enabled in the current browser. | |||||||||||
| preference (navigator) |
Gets or sets a user preference. Only available in privileged code. | |||||||||||
| registerContentHandler (navigator) |
Allows registering a web site as a possible handler for content of the specified MIME type. | |||||||||||
| registerProtocolHandler (navigator) |
|
Allows registering a web site as a possible handler for a protocol. | ||||||||||
| taintEnabled (clientInformation, navigator) |
Returns a Boolean value that indicates whether the data-tainting security model is enabled. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| clearData (clipboardData) |
Removes the specified formatted data from the clipboard. | ||||||
| getData (clipboardData) |
Retrieves the specified formatted data from the clipboard. | ||||||
| setData (clipboardData) |
Specifies the data and its format for the clipboard. |
| Method | Support | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| addReadRequest (userProfile) |
|
Adds an entry to the read-requests queue. | ||||||||||
| clearRequest (userProfile) |
|
Removes all requests from the read-requests queue. Use this method after all requested data has been retrieved. | ||||||||||
| doReadRequest (userProfile) |
|
Executes all requests from the read-requests queue. | ||||||||||
| getAttribute (userProfile) |
|
Returns the value of the specified attribute from the current userProfile object. | ||||||||||
| setAttribute (userProfile) |
|
Adds an attribute with the specified name and value to the current userProfile object. |
| Method | Support | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AddChannel (external) |
|
Displays a dialog box where the user has the ability to add a new channel URL, or modify the previously specified one. | ||||||||||
| AddDesktopComponent (external) |
Adds an item (image or website with location) to the Microsoft Active Desktop. | |||||||||||
| AddFavorite (external) |
Displays the 'Add a Favorite' dialog box for the specified URL and title in Internet Explorer. | |||||||||||
| addMicrosummaryGenerator (sidebar) |
Installs a microsummary generator. | |||||||||||
| addPanel (sidebar) |
Displays the 'Add Bookmark' dialog box for the specified URL and title in Firefox. | |||||||||||
| addPersistentPanel (sidebar) |
Displays the 'Add Bookmark' dialog box for the specified URL and title in Firefox. | |||||||||||
| addSearchEngine (sidebar) |
Installs a Sherlock formatted search engine plugin into the browser application. | |||||||||||
| AddSearchProvider (external, sidebar) |
|
Installs a search engine plugin into the browser application. | ||||||||||
| AutoCompleteSaveForm (external) |
Stores the values and names of the named input:password and input:text elements in the specified form for autocompletion. | |||||||||||
| AutoScan (external) |
|
Attempts to find a Web site based on the specified domain part. | ||||||||||
| IsSearchProviderInstalled (external, sidebar) |
|
Returns an integer that represents whether the specified search provider is installed and whether it is the default. | ||||||||||
| IsSubscribed (external) |
Returns whether the client is subscribed to the specified channel. | |||||||||||
| NavigateAndFind (external) |
Loads the document at the specified URL into the current window and selects the specified text. | |||||||||||
| ShowBrowserUI (external) |
Opens the specified system dialog. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| buildNumber (opera) |
Returns the build number of the browser in Opera. | ||||||
| collect (opera) |
Tries to initiate the JavaScript garbage collection. | ||||||
| postError (opera) |
Prints each argument as a separate message to the Error Console. | ||||||
| version (opera) |
Returns the version number of the browser in Opera. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| evalInSandbox (utils) |
Executes a piece of JavaScript code in a Sandbox object. | ||||||
| forceGC (utils) |
Allows to force a garbage collection (automatic memory management) cycle. | ||||||
| getWeakReference (utils) |
Returns an instance of the nsIWeakReference interface. | ||||||
| import (utils) |
Includes a JavaScript code module into the current script. You can define a scope for the contents of the imported file. | ||||||
| reportError (utils) |
Reports an error to the Error Console. | ||||||
| Sandbox (utils) |
Creates a Sandbox object that can be used as an executing environment for the evalInSandbox method. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| back (history, window) |
Loads the previous page form the history list into the current window. | ||||||
| forward (history, window) |
Loads the next page form the history list into the current window. | ||||||
| go (history) |
Loads a page from the history list into the current window. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| Constructor (Components) |
Creates a function that can be used to create an instance of the specified XPCOM component. | ||||||
| Exception (Components) |
Creates an XPCOM exception object that provides more complex error handling in JavaScript. | ||||||
| ID (Components) |
Creates an object that represents an IID (interface identifier). | ||||||
| isSuccessCode (Components) |
Returns a Boolean value that indicates whether the specified XPCOM result code is valid or not. |
| Method | Support | Description | |||||
|---|---|---|---|---|---|---|---|
| item (plugin) |
Returns a mimeType object that represents an associated MIME type, by index. | ||||||
| item (plugins) |
Returns a plugin object from the current collection by position. | ||||||
| namedItem (plugin) |
Returns a mimeType object that represents an associated MIME type, by name. | ||||||
| namedItem (plugins) |
Returns a plugin object from the current collection by name. | ||||||
| refresh (plugins) |
Refreshes the plugins collection to make the newly installed plugins available. |
| Method | Support | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| alert (crypto) |
|
Displays an alert window with the specified message and an OK button. The support for this method has been removed in Firefox 3.5. | ||||||||||
| disableRightClick (crypto) |
Disables the right mouse click. Not Implemented yet. | |||||||||||
| generateCRMFRequest (crypto) |
Generates a CRMF (Certificate Request Message Format) request. | |||||||||||
| importUserCertificates (crypto) |
Imports a certificate for the user. | |||||||||||
| logout (crypto) |
Logs the user out. | |||||||||||
| popChallengeResponse (crypto) |
||||||||||||
| random (crypto) |
Generates a random number. Not implemented yet. |
User Contributed Comments
