tooling/lib/openh264.js
async function injectSauce(def) {
  debug(`checking ${def.base} for firefox`);
  if (def.browserName.toLowerCase().includes('firefox')) {
    debug('def is a firefox def');
    const platform = platformToShortName(def.platform);

    if (platform !== 'mac') {
      throw new Error(`No tooling implemented for injecting h264 into ${platform} (${def.platform})`);
    }

    debug(`injecting ${platform} profile into ${def.base}`);
    const dir = path.resolve(process.cwd(), `${PROFILE_DIR}/${platform}`);

    debug(`profile is at ${dir}`);
    const profile = await copy(dir);
    const encoded = await encode(profile);

    // eslint-disable-next-line camelcase
    def.firefox_profile = encoded;
    debug(`injected ${platform} profile into def`);
  }
}
async function injectSauce(def) {
  debug(`checking ${def.base} for firefox`);
  if (def.browserName.toLowerCase().includes('firefox')) {
    debug('def is a firefox def');
    const platform = platformToShortName(def.platform);

    if (platform !== 'mac') {
      throw new Error(`No tooling implemented for injecting h264 into ${platform} (${def.platform})`);
    }

    debug(`injecting ${platform} profile into ${def.base}`);
    const dir = path.resolve(process.cwd(), `${PROFILE_DIR}/${platform}`);

    debug(`profile is at ${dir}`);
    const profile = await copy(dir);
    const encoded = await encode(profile);

    // eslint-disable-next-line camelcase
    def.firefox_profile = encoded;
    debug(`injected ${platform} profile into def`);
  }
}
async function injectSauce ( def ) { debug ( ` ${ def . base } ` ) ; if ( def . browserName . toLowerCase ( ) . includes ( 'firefox' ) ) { debug ( 'def is a firefox def' ) ; const platform = platformToShortName ( def . platform ) ; if ( platform !== 'mac' ) { throw new Error ( ` ${ platform } ${ def . platform } ` ) ; } debug ( ` ${ platform } ${ def . base } ` ) ; const dir = path . resolve ( process . cwd ( ) , ` ${ PROFILE_DIR } ${ platform } ` ) ; debug ( ` ${ dir } ` ) ; const profile = await copy ( dir ) ; const encoded = await encode ( profile ) ; // eslint-disable-next-line camelcase def . firefox_profile = encoded ; debug ( ` ${ platform } ` ) ; } }
Injects a gzipped, base64-encoded firefox profile directory into a Sauce Labs
browser definition
@param {Object} def
Injects a gzipped base64 - encoded firefox profile directory into a Sauce Labs browser definition