diff --git a/plugins/restiming.js b/plugins/restiming.js index 18e12684f..e9d752980 100644 --- a/plugins/restiming.js +++ b/plugins/restiming.js @@ -31,7 +31,10 @@ see: http://www.w3.org/TR/resource-timing/ // sendBeacon: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon "beacon": 8, // Fetch API: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API - "fetch": 9 + "fetch": 9, + "iframe": "a", + // IE11 and Edge (some versions) send "subdocument" instead of "iframe" + "subdocument": "a" }; // https://html.spec.whatwg.org/multipage/links.html#linkTypes diff --git a/tests/page-templates/06-bugs/issue-606.html b/tests/page-templates/06-bugs/issue-606.html new file mode 100644 index 000000000..a8f12798c --- /dev/null +++ b/tests/page-templates/06-bugs/issue-606.html @@ -0,0 +1,16 @@ +<%= header %> + +<%= boomerangSnippet %> + + + + +<%= footer %> diff --git a/tests/page-templates/06-bugs/issue-606.js b/tests/page-templates/06-bugs/issue-606.js new file mode 100644 index 000000000..aca932a58 --- /dev/null +++ b/tests/page-templates/06-bugs/issue-606.js @@ -0,0 +1,29 @@ +/*eslint-env mocha*/ +/*global BOOMR_test,assert*/ + +describe("e2e/06-bug/issue-606", function() { + var t = BOOMR_test; + var tf = BOOMR.plugins.TestFramework; + + it("Should pass basic beacon validation", function(done) { + t.validateBeaconWasSent(done); + }); + + it("Should only have one iframe and one CSS in the filter (if ResourceTiming is supported)", function() { + if (t.isResourceTimingSupported()) { + var b = tf.lastBeacon(); + + var resources = ResourceTimingDecompression.decompressResources(JSON.parse(b.restiming)); + + assert.equal(resources.length, 2); + + // find our iframe + assert.equal(resources[0].initiatorType, "other"); + assert.include(resources[0].name, "support/92542-iframe.html"); + + // find our css + assert.equal(resources[1].initiatorType, "css"); + assert.include(resources[1].name, "support/img.jpg"); + } + }); +}); diff --git a/tests/page-templates/06-bugs/support/09.css b/tests/page-templates/06-bugs/support/09.css new file mode 100644 index 000000000..39c519269 --- /dev/null +++ b/tests/page-templates/06-bugs/support/09.css @@ -0,0 +1,3 @@ +body { + background-image: url("img.jpg") +}