How to use the browsertime.browserScripts 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 / plugins / browsertime / analyzer.js View on Github external
'use strict';

const merge = require('lodash.merge');
const forEach = require('lodash.foreach');
const path = require('path');
const browsertime = require('browsertime');
const set = require('lodash.set');
const get = require('lodash.get');
const coach = require('webcoach');

const browserScripts = browsertime.browserScripts;

const defaultBrowsertimeOptions = {
  statistics: true
};

const iphone6UserAgent =
  'Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 ' +
  '(KHTML, like Gecko) Version/6.0 Mobile/10B329 Safari/8536.25';

async function parseUserScripts(scripts) {
  if (!Array.isArray(scripts)) scripts = [scripts];
  const allUserScripts = {};
  for (let script of scripts) {
    let myScript = await browserScripts.findAndParseScripts(
      path.resolve(script),
      'custom'

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