How to use the browsertime/lib/proxy/browserListenerProxy.setup function in browsertime

To help you get started, we’ve selected a few browsertime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sitespeedio / sitespeed.io / lib / analyze / browsertime.js View on Github external
useProxy: true
	};

	if (config.btConfig) {
		Object.keys(config.btConfig).forEach(function(key) {
			btConfig[key] = config.btConfig[key];
		});
	}

	log.log('info', 'Running browsertime for ' + browser + ' ' + url);

	browsers.setProxy(proxy);

	var bt = new Browsertime(browsers);

	browserListenerProxy.setup(bt, proxy, btConfig);

	bt.fetch(btConfig, function(err) {
		if (err) {
			return callback(err);
		}
		fs.readFile(measurementFile, function(err2, btData) {
			if (err2) {
				log.log('error', 'Couldn\'t read the file:' + measurementFile);
				return callback(err2);
			}

			// TODO we should only read the HAR if we ask for one
			fs.readFile(harFile, function(err3, harData) {
				if (err3) {
					log.log('error', 'Couldn\'t read the file:' + harFile);
					return callback(err3);

browsertime

Get performance metrics from your web page using Browsertime.

Apache-2.0
Latest version published 18 hours ago

Package Health Score

87 / 100
Full package analysis

Similar packages