-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed-up local browsers detection (Windows 7) #51
Comments
The current version should only look for a browser if you are actually trying to start it or want to list them all using We could add the ability for Launchpad to look for environment variables (e.g. |
This is exactly what I was thinking about, i.e. to check env variables first, then try pre-configured default locations. Although this is a good idea it does not solve a whole issue. Thing is So it seems to me that to fully resolve this problem the following needs to be done:
|
BTW: I am happy to work on a PR if you think this idea makes sense. |
That would be fantastic. Probably two separate PRs for 1) and 2). For 1) I'd make |
For 1, the discovery is happening at https://github.com/ekryski/launchpad/blob/master/lib/local/browser.js#L18 which is probably the place to check for the command line parameter. Maybe something like var envSetting = process.env['LAUNCHPAD_' + browser.name.toUpperCase()];
var location = envSetting || browser.defaultLocation;
if (location && fs.existsSync(location)) {
debug('Found browser ' + current.name + ' in location', location);
return setPath(current, browser.defaultLocation);
}
if(envSetting === 'false') {
return null;
} That might almost be it. Testing it might be a little more tricky especially in CI. |
Looks like you almost did it. 👍 I hope to find some time to finish this up in next few days. |
status? 😄 |
I've got both LAUNCHPAD_ & LAUNCHPAD_BROWSERS implemented. See mazswojejzony@a63e468 The downside is I find it really hard to add new tests for those features. I tried to use grunt-env (to change env settings for separate grunt test tasks) + mockery (to ensure the launchpad local module is reinitialized after env settings are changed) but I failed to find a working solution. Any thoughts? |
We could always run the tests with environment variables set and install the local PhantomJS NPM package in development mode. Then you'd just have to change the |
That would kind of work for What about the LAUNCHPAD_BROWSERS? Would it be OK if it was set to
to:
The downside is we would not test the default path when no env vars are set. |
I've found a way to test this using decache to re-init the local module. See PR for details. |
On my machine (Core-i5 + SSD) browser detection takes approx. 1min 5s. The reason is that Chrome is installed in
"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
folder (i.e. not in the AppData sub-folder). Also I do not have Opera nor phantomjs installed.So what happens is
launchpad
tries to find those browsers usingpathQuery
e.g.dir /s /b opera.exe
command which takes lots of time to complete.Are there any plans to provide means to change platform browsers configuration so that users could define what local browsers they want to use and where they are installed?
The text was updated successfully, but these errors were encountered: