A computer-implemented method for monitoring performance of an application being executed by a web browser residing on a computing device and rendering content received from a web server, comprising:
- detecting, by a sensor, a user interaction with the web browser and a content update request caused by the user interaction, where the sensor is instrumented in the content displayed by the web browser and executed by a processor of the computing device;
- sending, by the sensor, an update notification to a browser agent in response to detecting the user interaction and the content update request caused by the user interaction, where the update notification indicates a possible update to a document object model which represents content displayed by the web browser;
- receiving, by the browser agent, the update notification pertaining to the document object model, where the browser agent is injected into the content displayed by the web browser and executed by the processor of the computing device;
- periodically determining, by the browser agent, whether an update of the document object model has occurred, the determination being performed in response to receiving the update notification pertaining to the document object model;
- identifying, by the browser agent, elements added to the document object model according to the update notification, where the identified elements contain resource load directives which are serviced by data source other than the web server and were not previously instrumented;
- and
- instrumenting, by the browser agent, an identified element with a resource sensor, where the resource sensor is comprised of instructions that are executed by the processor upon occurrence of a resource load event and generates an event message regarding the resource load event associated with the identified element.