Methods

This section describes the methods supported by the Diagnostics Engine.

Note  These APIs can only be used with F12 developer tools and the Diagnostics Script Engine, and can't be called from JavaScript.

 

In this section

Topic Description

addEventListener

Registers an event listener of the given type to the object.

removeEventListener

Unregisters a previously registered event listener of the given type.

addCustom

Adds a custom user agent (UA) string with a category of "Custom" into the collection of UA strings.

allowProcessToTakeForeground

Calls the Win32 API AllowSetForegroundWindow to allow a specific process to go to the foreground.

calculateTracedStyles

Calculate the style tracing info. All calls to getTracedStyles following this call return data frozen to the point of this call.

clearAccuracy

Clears the accuracy of the latitude and longitude properties.

clearAll

Clears all GeoLocation parameters.

clearAllCookies

Clears the browser's cookies.

clearAllCookiesForDomain

Clears the browser's cookies for the current domain.

clearAllUrlRedirects

Removes all URLs in a redirection table.

clearAltitude

Clears the current altitude property.

clearAltitudeAccuracy

Clears the current accuracy of the altitude property.

clearAppCache

Clears the AppCache.

clearBrowserCache

Clears the browser cache.

clearBrowserCacheForDomain

Clears the browser cache for the current page.

clearHeading

Clears the current heading, or direction of travel.

clearIndexedDB

Removes an indexedDB object.

clearInterval

Removes the callback associated with the setInterval call.

clearLatitude

Clears the current latitude for GeoLocation.

clearLongitude

Clears the current longitude for GeoLocation.

clearSpeed

Clears the current ground speed for GeoLocation.

clearTimeout

Removes the callback associated with the setTimeout call.

clearUrlRedirect

Removes all entries of a specific URL in a table of redirects.

clearWorkerMemoryProfiles

Clears a worker profile.

createCookie

Creates a new cookie.

createSafeFunction

Returns a function wrapping the passed-in function.

createSafeFunction

Returns a function wrapping the passed-in function.

deleteCookie

Deletes a cookie.

disableAll

Disables all cookies.

executeScript

Synchronously runs a script in the WebWorkerDiagnosticsDiagnostics object model.

executeScriptAsync

Asynchronously executes a script in the DiagnosticsWebWorker object model.

getActiveStyling

Returns whether a passed element is currently active.

getAllCookies

Returns an array of DiagnosticsCookies objects.

getAppliedProperties

Returns a list of all Cascading Style Sheets (CSS) properties that have been applied to an element.

getAppliedStyles

Returns a list of styles associated with an element which could have applied a given property.

getCrossSiteWindow

Gets a window from a different domain than current page.

getDynamicPropertyList

Returns an unordered list of properties that have been modified in the DOM after the style declaration was created.

getElementByUniqueId

Gets an element based on its unique id.

getElementEventHelper

Returns a DiagnosticsElementEventHelper object for a specific element.

getElementInnerHTML

Returns a string containing a specific element’s innerHTML content.

getElementOuterHTML

Returns a string containing a specific element’s outerHTML content.

getEventHandlers

Returns an array of DiagnosticsElementEventListeners.

getFocusStyling

Returns whether a passed element is currently in focus.

getHoverStyling

Returns whether a passed element currently is in a hover state.

getInheritanceChain

Returns a list of elements from which this element could a given property.

getLinkStyling

Returns whether a passed element is in a link state with associated CSS styling.

getMemoryProfile

Returns a snapshot of the diagnostics engine on the main UI thread.

getMemoryProfileFromWorkerURN

Returns a worker memory profile for a specific URN.

getMemoryProfileURN

Returns a snapshot of the worker thread and returns a URN.

getParsedPropertyList

Returns an ordered list of properties that were parsed when the style declaration was created.

getSourceLocation

Returns an object that contains the line, column, and file location of a style declaration in its original source.

getSpecificity

Obtains the specificity of a passed selector or list of selectors, as per the W3C spec on selector specificity.

getTracedStyles

Returns an object that represents the style tracing for an element.

getVisitedStyling

Returns whether a passed element is in a visited state.

hasSignal

Sets or gets the signal emulation to use when the device does not have a geolocation signal.

heading

Get or set the heading or direction.

highlightElement

Displays a highlighting box and rules for a given element, using CSS colors passed in string form for each of the box-model regions.

isInheritable

Returns whether a property can be inherited by this element.

latitude

Get or set the latitude in the GeoLocation object, in decimal degrees.

longitude

Get or set the longitude in the DiagnosticsGeoLocation object, in decimal degrees.

postMessage

Asynchronously posts a message to the web worker thread.

postMessage

Posts a message to a DiagnosticsWebWorker object in the Diagnostics object model.

refresh

Refreshes the current page.

removeCustom

Remove a custom user agent string (UA) from the collection of UA strings.

restoreOriginalSettings

Resets the viewport to cached dimensions and orientation.

sendMessage

Sends a message to the COM host of the Diagnostics Script Engine.

setActiveStyling

Sets a passed element to an active state.

setBrowserMode

Sets the browser mode.

setCookie

Applies the changes made to the DiagnosticsCookieEntry to the page.

setCurrentToDefault

Removes any applied value from the current User Agent string, and resets it to the default for the page.

setDimensions

Gets or sets the viewport's dimensions in pixels.

setFocusStyling

Sets an element to a focused state.

setHoverStyling

Sets a passed element to a hovered state.

setInterval

Calls a callback function after every delay in milliseconds has elapsed.

setLinkStyling

Sets a passed element to a link state with associated CSS styling.

setPosition

Sets the current position in GeoLocation.

setTimeout

Invokes a callback function after a set number of milliseconds has passed.

setUrlRedirect

Replaces a URL with another to cause a redirect.

setVisitedStyling

Sets whether a passed element is currently in a visited state.

takeForeground

Causes Windows Internet Explorer to try to take the Win32 foreground for itself.

takeVisualSnapshot

Takes a screen capture of the current document.

triggerGarbageCollection

Starts the JavaScript garbage collector.