You are here: Reference > JavaScript > client-side > browser > methods

Browser related methods in JavaScript

Moving and resizing the browser window:
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.
Navigator methods:
Method Support Description
isSupported
9
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)
3
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.
ClipboardData methods:
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.
UserProfile methods:
Method Support Description
addReadRequest
(userProfile)
9
Adds an entry to the read-requests queue.
clearRequest
(userProfile)
9
Removes all requests from the read-requests queue. Use this method after all requested data has been retrieved.
doReadRequest
(userProfile)
9
Executes all requests from the read-requests queue.
getAttribute
(userProfile)
9
Returns the value of the specified attribute from the current userProfile object.
setAttribute
(userProfile)
9
Adds an attribute with the specified name and value to the current userProfile object.
External methods:
Method Support Description
AddChannel
(external)
7
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)
7
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)
7
Attempts to find a Web site based on the specified domain part.
IsSearchProviderInstalled
(external, sidebar)
7
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.
Opera object methods:
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.
Utility methods:
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.
History methods:
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.
Component methods:
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.
Plugin methods:
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.
Cryptographic methods:
Method Support Description
alert
(crypto)
3.5
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

Post Content

Post Content