diff --git a/js/editable-css.js b/js/editable-css.js index 102b775fb..43652b551 100644 --- a/js/editable-css.js +++ b/js/editable-css.js @@ -103,6 +103,8 @@ 'CSS editor load time', performance.timing.loadEventEnd ); + // Posts mark to set on the Kuma side and used in measure + mceUtils.postToKuma({ markName: 'css-ie-load-event-end' }); }, 100); } }); diff --git a/js/editable-js.js b/js/editable-js.js index 45dd4d452..4831781e6 100644 --- a/js/editable-js.js +++ b/js/editable-js.js @@ -4,6 +4,7 @@ var featureDetector = require('./editor-libs/feature-detector.js'); var mceConsole = require('./editor-libs/console'); var mceEvents = require('./editor-libs/events.js'); + var mceUtils = require('./editor-libs/mce-utils'); var codeBlock = document.getElementById('static-js'); var exampleFeature = codeBlock.dataset['feature']; @@ -116,6 +117,8 @@ 'JS editor load time', performance.timing.loadEventEnd ); + // Posts mark to set on the Kuma side and used in measure + mceUtils.postToKuma({ markName: 'js-ie-load-event-end' }); }, 300); } }); diff --git a/js/editor-libs/mce-utils.js b/js/editor-libs/mce-utils.js index b5a24e68c..083e35da9 100644 --- a/js/editor-libs/mce-utils.js +++ b/js/editor-libs/mce-utils.js @@ -37,6 +37,14 @@ module.exports = { return tmpElem.style[property] !== undefined; }, + /** + * Posts a name to set as a mark to Kuma for + * processing and beaconing to GA + * @param {Object} perf - The performance object sent to Kuma + */ + postToKuma: function(perf) { + window.parent.postMessage(perf, 'https://developer.mozilla.org'); + }, /** * Hides the default example and shows the custom block * @param {object} customBlock - The HTML section to show diff --git a/js/editor.js b/js/editor.js index da4cb426b..0ab440d33 100644 --- a/js/editor.js +++ b/js/editor.js @@ -2,6 +2,7 @@ 'use strict'; var mceEvents = require('./editor-libs/events.js'); + var mceUtils = require('./editor-libs/mce-utils'); var shadowOutput = require('./editor-libs/shadow-output'); var templateUtils = require('./editor-libs/template-utils'); var tabby = require('./editor-libs/tabby'); @@ -143,6 +144,8 @@ 'Tabbed editor load time', performance.timing.loadEventEnd ); + // Posts mark to set on the Kuma side and used in measure + mceUtils.postToKuma({ markName: 'tabbed-ie-load-event-end' }); }, 100); } });