diff --git a/boomerang.js b/boomerang.js index 913ef3ad4..0ab0ce655 100644 --- a/boomerang.js +++ b/boomerang.js @@ -156,9 +156,10 @@ BOOMR_check_doc_domain(); document.getElementById("boomr-if-as") && document.getElementById("boomr-if-as").nodeName.toLowerCase() === "script") { w = w.parent; - myurl = document.getElementById("boomr-if-as").src; } + myurl = (document.currentScript || document.getElementById("boomr-if-as") || document.getElementById("boomr-scr-as")).src; + d = w.document; // Short namespace because I don't want to keep typing BOOMERANG diff --git a/tests/page-templates/11-restiming/06-iframes.js b/tests/page-templates/11-restiming/06-iframes.js index 7abde20ff..8620b491b 100644 --- a/tests/page-templates/11-restiming/06-iframes.js +++ b/tests/page-templates/11-restiming/06-iframes.js @@ -31,8 +31,8 @@ describe("e2e/11-restiming/06-iframes", function() { var url = pageResources[i].name; // ideally, we should skip anything in RT that is newer than our beacon - // skip beacon URL - if (url.indexOf(BOOMR.getBeaconURL()) !== -1) { + // skip beacon, boomerang, & config URLs + if (url.indexOf(BOOMR.getBeaconURL()) !== -1 || url === BOOMR.url || url === BOOMR.config_url) { continue; } // skip favicon which is requested after beacon diff --git a/tests/page-templates/11-restiming/08-cross-origin.js b/tests/page-templates/11-restiming/08-cross-origin.js index d55af6998..14bb587a5 100644 --- a/tests/page-templates/11-restiming/08-cross-origin.js +++ b/tests/page-templates/11-restiming/08-cross-origin.js @@ -30,8 +30,8 @@ describe("e2e/11-restiming/06-iframes", function() { for (var i = 0; i < pageResources.length; i++) { var url = pageResources[i].name; - // skip beacon URL - if (url.indexOf("beacon") !== -1) { + // skip beacon, boomerang, & config URLs + if (url.indexOf(BOOMR.getBeaconURL()) !== -1 || url === BOOMR.url || url === BOOMR.config_url) { continue; } diff --git a/tests/unit/04-plugins-mq.js b/tests/unit/04-plugins-mq.js index 21317dd6a..13184d903 100644 --- a/tests/unit/04-plugins-mq.js +++ b/tests/unit/04-plugins-mq.js @@ -17,7 +17,7 @@ describe("BOOMR.plugins.mq", function() { describe("push()", function() { it("Should handle degenerate cases", function() { assert.doesNotThrow(function() { - BOOMR_mq.push( + BOOMR.window.BOOMR_mq.push( null, undefined, false, @@ -44,14 +44,14 @@ describe("BOOMR.plugins.mq", function() { BOOMR.method = function() { done(); }; - BOOMR_mq.push(["method"]); + BOOMR.window.BOOMR_mq.push(["method"]); }); it("Should call namespaced methods on BOOMR", function(done) { BOOMR.method = function() { done(); }; - BOOMR_mq.push(["BOOMR.method"]); + BOOMR.window.BOOMR_mq.push(["BOOMR.method"]); }); it("Should pass all arguments", function(done) { @@ -62,7 +62,7 @@ describe("BOOMR.plugins.mq", function() { assert.equal(arguments[2], 2); done(); }; - BOOMR_mq.push(["method", 0, 1, 2]); + BOOMR.window.BOOMR_mq.push(["method", 0, 1, 2]); }); it("Should support `push` with multiple arguments", function(done) { @@ -79,7 +79,7 @@ describe("BOOMR.plugins.mq", function() { assert.equal(results[1], "method2"); done(); }; - BOOMR_mq.push( + BOOMR.window.BOOMR_mq.push( ["method1"], ["method2"], ["method3"] @@ -92,7 +92,7 @@ describe("BOOMR.plugins.mq", function() { done(); } }; - BOOMR_mq.push(["obj.method"]); + BOOMR.window.BOOMR_mq.push(["obj.method"]); }); it("Should step into functions on BOOMR", function(done) { @@ -100,7 +100,7 @@ describe("BOOMR.plugins.mq", function() { BOOMR.func.method = function() { done(); }; - BOOMR_mq.push(["func.method"]); + BOOMR.window.BOOMR_mq.push(["func.method"]); }); it("Should use appropriate context", function(done) { @@ -112,7 +112,7 @@ describe("BOOMR.plugins.mq", function() { done(); } }; - BOOMR_mq.push(["obj.method1"]); + BOOMR.window.BOOMR_mq.push(["obj.method1"]); }); }); @@ -121,7 +121,7 @@ describe("BOOMR.plugins.mq", function() { BOOMR.method = function() { done(); }; - BOOMR_mq.push({ + BOOMR.window.BOOMR_mq.push({ arguments: ["method"] }); }); @@ -129,7 +129,7 @@ describe("BOOMR.plugins.mq", function() { BOOMR.method = function() { return 123; }; - BOOMR_mq.push({ + BOOMR.window.BOOMR_mq.push({ arguments: ["method"], callback: function() { assert.lengthOf(arguments, 1); @@ -148,7 +148,7 @@ describe("BOOMR.plugins.mq", function() { }; BOOMR.method = function() {}; - BOOMR_mq.push({ + BOOMR.window.BOOMR_mq.push({ arguments: ["method"], callback: Item.prototype.callback, thisArg: new Item(123)