Patent ID: 8245200

Claim:
A computer program product for tracing JavaScript code execution on a client device executing JavaScript code, the computer program product comprising a single block of JavaScript code configured to execute on the client device, the operations of the computer program product comprising: receiving profiler JavaScript code from a server; receiving user-defined JavaScript code from the server; loading the profiler JavaScript code in the memory on the client device, the profiler JavaScript code configured to dynamically redefine each function of a registered target JavaScript object in the memory on the client device; loading the user-defined JavaScript code in memory on the client device, the user-defined JavaScript code comprising a registration JavaScript instruction; registering a target JavaScript object in a memory on the client device, in response to loading a registration JavaScript instruction, the registration JavaScript instruction identifying the target JavaScript object, the target JavaScript object defined in the user-defined JavaScript code, the profiler JavaScript code dynamically loading the registered target JavaScript object; modifying the user-defined JavaScript code at runtime in memory on the client device for each JavaScript object identified by a registration JavaScript instruction in the user-defined JavaScript code by injecting a logging code into the JavaScript object and storing the modified user-defined JavaScript object in memory on the client device, the logging code comprising; an event added to each function of the target JavaScript object of the modified user-defined JavaScript object identifying when the function of the target JavaScript object is called; an event added to each function of the target JavaScript object of the modified user-defined JavaScript code identifying when the function of the target JavaScript object is exited; and an event added to each function of the target JavaScript object of the modified user-defined JavaScript code identifying when an exception occurs within the function of the target JavaScript object; logging execution of each function of the modified user-defined JavaScript object in response to runtime calls to the function of the modified user-defined JavaScript object from the user-defined JavaScript code; and outputting the log.