ProxyXHRImplementation


Proxy XMLHttpRequest object

Methods


addListener(ename, stat)

Setup an {EventListener} for Event @param{ename}. This function will make sure the timestamp for the resources request is set and calls loadFinished should the resource have finished.

See open() for it's usage

Parameters:

Name Type Description
ename String

Eventname to listen on via addEventListener

stat String

if that ename is reached set this as the status of the resource


BOOMR.proxy_XMLHttpRequest(method, url [, async])

Open an XMLHttpRequest. If the URL passed as a second argument is in the BOOMR.xhr_exclude list ignore it and move on to request it Otherwise add it to our list of resources to monitor and later beacon on.

If an exception is caught will call loadFinished and set resource.status to XHR_STATUS_OPEN_EXCEPTION Should the resource fail to load for any of the following reasons resource.stat status code will be set to:

  • timeout {Event} XHR_STATUS_TIMEOUT
  • error {Event} XHR_STATUS_ERROR
  • abort {Event} XHR_STATUS_ABORT

Parameters:

Name Type Argument Description
method string

HTTP request method

url string

URL to request on

async boolean <optional>

If true will setup the EventListeners for XHR events otherwise will set the resource to synchronous. If true or undefined will be automatically set to asynchronous


loadFinished()

Mark this as the time load ended via resources loadEventEnd property, if this resource has been added to the MutationHandler already notify that the resource has finished. Otherwise add this call to the lise of Events that occured.


req.send()

Mark requestStart timestamp and start the request unless the resource has already been marked as having an error code or a result to itself.

Returns:

Type: Object

The data normal XHR.send() would return