@@ -8,6 +8,17 @@ Elm.debuggerAttach = function(module) {
8 make: function(runtime) {
8 make: function(runtime) {
9 var wrappedModule = debugModule(module, runtime);
9 var wrappedModule = debugModule(module, runtime);
10 Elm.Debugger = debuggerInit(wrappedModule, runtime);
10 Elm.Debugger = debuggerInit(wrappedModule, runtime);
12+ var dispatch = function(_) {
13+ parent.window.postMessage("elmDebuggerInit", window.location.origin);
15+ if (parent.window.document.readyState === "complete") {
19+ parent.window.addEventListener("load", dispatch);
11 return wrappedModule.moduleInstance;
22 return wrappedModule.moduleInstance;