Bug #57

Work with dynaTrace team to provide good hook for debugging

Added by Dylan Schiemann over 5 years ago. Updated over 5 years ago.

Status:New Start date:04/24/2012
Priority:Normal Due date:05/15/2012
Assignee:Kris Zyp % Done:


Target version:Mid May 2012


dynaTrace would like an easier way to hook into Dojo for debugging. See thread below.

Note this ticket is for planning and deciding on the API approach, the actual implementation related ticket should be done through trac.


Hi Alois,

It's good to hear from you.

A few thoughts... dojo.ready is really the Dojo 1.6 and earlier way of doing things, 1.7 and newer uses the AMD syntax, see http://livedocs.dojotoolkit.org/dojo/domReady

This either makes your problem a bit easier or a bit harder to solve.

It may be worth trying to hook into the tracking portion of the AMD spec. Or it may make sense to set a dojo-config property specific to DynaTrace, and then rely on either dojox/lang/aspect, or just a method like yours, to call dynaTrace first.

I've copied Kris Zyp, Eugene Lazutkin, and Rawld Gill, to get their thoughts and feedback on how to best build this into Dojo. I've also opened a ticket


on 4/24/12 2:40 AM (GMT-07:00) Alois Reitbauer said the following:

Hey Dylan,

Hope you are fine. Did not hear from you in a while. We are currently
building monitoring support for dojo. So we it works great and we can
capture everything up to event details. The only issue we have is
getting our wrapper attached at runtime. Currently we advise our
customers to modify the dojo JS file, which is not really the coolest

Below you can find the input from the developer who is working on our
framework hooking. It would be great if we could get the proposed
extensions into dojo.

What do you think?

// Alois

We wrap the onReady callback to be able to attach all Ajax actions
happening during onReady callbacks do the load action of the page.

function onReadyWrapper(){



Var _originalOnReady = dojo.ready;

Dojo.ready= dojo.addOnLoad = onReadyWrapper;

Our javascript agent is injected as first script tag into a page. So
when our script runs there is no Dojo or any other JS executed. What we
need to do is to hook all Dojo functions as soon as Dojo is ready. The
“onload” event on window is too late. The ideal time would be
immediately after the script tag loading Dojo. As there is no
possibility to execute code here we have to tell our customers to add
some code at the end of their dojo.js file (something like
dynaTrace.initDojo()). This is very annoying and sometimes not easy to
handle for customers.

The easiest solution for us would be something like that:

dynaTrace sets a property window.onBeforeDojoReady=function(){[…]}

Before Dojo calls the first read handler, it checks for window.
onBeforeDojoReady and executes it if it is set.

Also available in: Atom PDF