@@ -8,22 +8,26 @@ 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);
11− if (parent.window) {
11+ dispatchElmDebuggerInit();
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);
22 return wrappedModule.moduleInstance;
12 return wrappedModule.moduleInstance;
17+function dispatchElmDebuggerInit() {
19+ var dispatch = function(_) {
20+ parent.window.postMessage("elmDebuggerInit", window.location.origin);
22+ if (parent.window.document.readyState === "complete") {
26+ parent.window.addEventListener("load", dispatch);
27function debugModule(module, runtime) {
31function debugModule(module, runtime) {
28 var programPaused = false;
32 var programPaused = false;
29 var recordedEvents = [];
33 var recordedEvents = [];