#Loupe Native JavaScript Agent The native JavaScript agent has been designed to be self contained so that it will not effect any other 3rd party scripts you may be using, as long as you are able to access the `window` object and the `window.onerror` event the agent will function. ## Unhandled exceptions As mentioned above this agent will attach itself to the `window.onerror` event recording any existing `onerror` event handler and ensuring that if an existing handler exists that it is called called prior to the agent logging the exception. If you want to perform additional actions *after* the agent then if you set `propagateOnError` to `true` will mean that the agent `onerror` will not indicate it has handled the error and it will then be passed onto whatever function is handling the error next. ## Logging See [[Logging|Logging]] for details on the methods available to log and details on how to log. ## COR support The native agent is able to make Cross Origin Requets as long as the `corsOrigin` is set to the domain where the call needs to be made e.g. if my server is hosted at http://www.mydomain.com but my script is loaded into http://www.theclient.org then I need to call `corsOrigin("http://www.mydomain.com")` so that the agent can send the log messages to the correct server.