diff --git a/src/build.js b/src/build.js index c6d1c4a9..45f032a0 100644 --- a/src/build.js +++ b/src/build.js @@ -12,7 +12,7 @@ fs.writeFileSync( // part of fix for iframing issue .replace('(function initHammerheadClient () {', '(function initHammerheadClient () {' + 'if (window["%is-hammerhead%"]) throw new TypeError("already ran"); window["%is-hammerhead%"] = true;' + - 'window.rammerheadTop = (function() {var w = window; while (w !== w.top && w.parent["%hammerhead"]) w = w.parent; return w;})();' + + 'window.rammerheadTop = (function() {var w = window; while (w !== w.top && w.parent["%hammerhead%"]) w = w.parent; return w;})();' + 'window.rammerheadParent = window.rammerheadTop === window ? window : window.parent;' + 'window.distanceRammerheadTopToTop = (function() { var i=0,w=window; while (w !== window.top) {i++;w=w.parent} return i; })();' + 'window.rammerheadAncestorOrigins = Array.from(location.ancestorOrigins).slice(0, -window.distanceRammerheadTopToTop);\n')