james-proxy / james-browser-launcher

Detect, launch and stop browsers
Other
23 stars 15 forks source link

Firefox developer edition doesn't show up in detect list #8

Closed mitchhentges closed 8 years ago

mitchhentges commented 8 years ago

@epmatsw, I checkout out your fix, but it replaced the normal version of firefox with the developer edition, rather than showing both.

Current behaviour:

$ node example/detect.js 
Available browsers:
[ { name: 'chrome',
    version: '48.0.2564.116',
    type: 'chrome',
    command: '/Applications/Google Chrome.app' },
  { name: 'firefox',
    version: '44.0.2',
    type: 'firefox',
    command: '/Applications/Firefox.app/Contents/MacOS/firefox-bin' },
  { name: 'phantomjs',
    version: '2.1.1',
    type: 'phantom',
    command: 'phantomjs' },
  { name: 'safari',
    version: '9.0.3',
    type: 'safari',
    command: '/Applications/Safari.app' } ]

epmatsw's fix behaviour:

$ node example/detect.js 
Available browsers:
[ { name: 'chrome',
    version: '48.0.2564.116',
    type: 'chrome',
    command: '/Applications/Google Chrome.app' },
  { name: 'firefox',
    version: '46.0a2',
    type: 'firefox',
    command: '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin' },
  { name: 'phantomjs',
    version: '2.1.1',
    type: 'phantom',
    command: 'phantomjs' },
  { name: 'safari',
    version: '9.0.3',
    type: 'safari',
    command: '/Applications/Safari.app' } ]

Ideal behaviour:

[ { name: 'chrome',
    version: '48.0.2564.116',
    type: 'chrome',
    command: '/Applications/Google Chrome.app' },
  { name: 'firefox',
    version: '44.0.2',
    type: 'firefox',
    command: '/Applications/Firefox.app/Contents/MacOS/firefox-bin' },
  { name: 'firefox',
    version: '46.0a2',
    type: 'firefox',
    command: '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin' },
  { name: 'phantomjs',
    version: '2.1.1',
    type: 'phantom',
    command: 'phantomjs' },
  { name: 'safari',
    version: '9.0.3',
    type: 'safari',
    command: '/Applications/Safari.app' } ]
epmatsw commented 8 years ago

Hmmm. It's been a while, but I think that this is the default behavior of browser launcher when multiple versions of the same browser are present. Since FF and FF Dev edition use the same profile, it seemed reasonable to treat them as the same browser. Easy fix would be to treat Dev Edition like Canary, but then you'd have to pick it explicitly. Could also change the behavior to return all matches, but I dunno how much work that would take or how much that would break.

mitchhentges commented 8 years ago

On Windows, it already works out-of-box with showing Firefox and Firefox Dev and different versions of IE properly.

I'm still figuring out the code, but I think it supports it.