sitespeedio / sitespeedio/chromedriver

In chromedriver, in index.js script, function binPath with error in return, please fix it

Open
#8 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Have you read the documentation?
URL

I use local url, sorry can not repro

What are you trying to accomplish

in your code, binPath function never return driverPath for win32, linux and arm os:

binPath: function() {
let driverPath = path.resolve(__dirname, 'vendor', 'chromedriver');
if (os.platform() === 'win32') {
driverPath = driverPath + '.exe';
} else if (
(os.platform() === 'linux' && os.arch() === 'arm') ||
os.arch() === 'arm64'
) {
// Special handling for making it easy on Raspberry Pis
try {
const potentialChromdriverPath = execSync('which chromedriver');
if (potentialChromdriverPath !== undefined) {
return potentialChromdriverPath.toString().trim();
}
} catch (e) {
// Just swallow
}
} else {
return driverPath;
}
}

please fix to:

binPath: function() {
let driverPath = path.resolve(__dirname, 'vendor', 'chromedriver');
if (os.platform() === 'win32') {
driverPath = driverPath + '.exe';
} else if (
(os.platform() === 'linux' && os.arch() === 'arm') ||
os.arch() === 'arm64'
) {
// Special handling for making it easy on Raspberry Pis
try {
const potentialChromdriverPath = execSync('which chromedriver');
if (potentialChromdriverPath !== undefined) {
return potentialChromdriverPath.toString().trim();
}
} catch (e) {
// Just swallow
}
}
return driverPath;
}

What browser did you use?

Chrome

How to reproduce
any iteration
Relevant log output

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open index.js and inspect the chromedriver binPath function, focusing on the platform branches and their return paths. Exercise the function for Windows, Linux, and ARM platforms, and verify that it returns driverPath when no system chromedriver path is selected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.