Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var launchCfg = {
url: defaultLaunchURL,
bin: opts.executablePath || '',
args: []
};
if (opts.headless) {
launchCfg.args.push('--headless');
}
if (opts.userDataDir) {
launchCfg.args.push('--profile');
launchCfg.args.push(opts.userDataDir);
}
const { browser: fdBrowser, tab: fdTab } = await foxdriver.launch(launchCfg);
if (opts.throttling) {
const downloadThroughput = opts.throttling.downloadThroughput || 75000
const uploadThroughput = opts.throttling.uploadThroughput || 25000
const latency = opts.throttling.latency || 100
await fdTab.emulation.setNetworkThrottling(downloadThroughput, uploadThroughput, latency);
}
return new browser({fdBrowser, fdTab});
}
}
constructor(launcher, throttler) {
super()[_throttler_] = throttler;
this.open = true;
this[_remote_] = FoxDriver.launch( launcher ).then(
({ browser }) => browser
);
}