Skip to content
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

On Windows, it detects Chrome stable, but launches Chrome-Canary #40

Open
jakub-g opened this issue Sep 4, 2015 · 1 comment
Open

Comments

@jakub-g
Copy link

jakub-g commented Sep 4, 2015

Windows 7 64-bit, node 0.10.40 / 0.12.7, Chrome stable (45) and Canary (47) installed

When I run the following code:

var launcher = require("browser-launcher2");

launcher.detect( function( available ) {
    // console.log( 'Available browsers:' );
    // console.dir( available );

    console.log( 'Available Chromes:' );
    console.dir( available.filter(function(item){
        return item.name == 'chrome'
    }) );

    launcher( function( err, launch ) {
        if ( err ) {
            return console.error( err );
        }
        launch( 'http://example.org/', 'chrome', function( err, instance ) {
            if ( err ) {
                return console.error( err );
            }

            console.log( 'Instance started with PID:', instance.pid );

            instance.on( 'stop', function( code ) {
                console.log( 'Instance stopped with exit code:', code );
            } );
        } );
    } );
} );

the output is

$ node bug.js
Available Chromes:
[ { name: 'chrome',
    version: '45.0.2454.85',
    type: 'chrome',
    command: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe' } ]
Instance started with PID: 7960
Instance stopped with exit code: 0

(it detects Chrome stable)

But then, Chrome Canary windows pops out on screen.

So it seems that detection logic and launch logic is different

@jakub-g
Copy link
Author

jakub-g commented Sep 4, 2015

Ah, well, it's once again the caching issue.

I looked up ~/.config/browser-launcher2/config.json and it contained Canary entry, apart from regular Chrome entry, and somehow the tool decided to use Canary instead of stable in this case.

Deleted it, and now the file was recreated but without Canary entry.

I will need to dig further to understand what's going on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant