Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
37 lines
787 B
JavaScript
Executable file
37 lines
787 B
JavaScript
Executable file
'use strict';
|
|
|
|
(function(exports) {
|
|
if ('MozReflowAtom' in exports) {
|
|
return;
|
|
}
|
|
|
|
exports.MozReflowAtom = {
|
|
count: null,
|
|
_trackingManifest: null,
|
|
|
|
init: function rw_init() {
|
|
exports.addEventListener('developer-hud-update', this);
|
|
},
|
|
|
|
handleEvent: function rw_handleEvent(evt) {
|
|
var metric = evt.detail.metric.name || evt.detail.metric;
|
|
if (metric !== 'reflows' ||
|
|
evt.detail.manifest !== this._trackingManifest) {
|
|
return;
|
|
}
|
|
this.count++;
|
|
},
|
|
|
|
startTracking: function(manifestURL) {
|
|
this._trackingManifest = manifestURL;
|
|
this.count = 0;
|
|
},
|
|
|
|
stopTracking: function() {
|
|
this.count = 0;
|
|
this._trackingManifest = null;
|
|
},
|
|
};
|
|
|
|
exports.MozReflowAtom.init();
|
|
})(window);
|