How to use the browsertime/lib/browsers.setProxy 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
logDir: config.run.absResultDir,
		waitScript: config.waitScript,
		customScripts: config.customScripts,
		seleniumServer: config.seleniumServer,
		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

browsertime

Get performance metrics from your web page using Browsertime.

Apache-2.0
Latest version published 1 month ago

Package Health Score

81 / 100
Full package analysis

Similar packages