diff --git a/pkgs/browser_launcher/CHANGELOG.md b/pkgs/browser_launcher/CHANGELOG.md index 9f9759aa0..42f89bf24 100644 --- a/pkgs/browser_launcher/CHANGELOG.md +++ b/pkgs/browser_launcher/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.9 + + - Add support for Chrome executables in `CHROME_PATH`. + ## 0.1.8 - Log `STDERR` on Chrome launch failure. diff --git a/pkgs/browser_launcher/lib/src/chrome.dart b/pkgs/browser_launcher/lib/src/chrome.dart index bfa427095..04d0262d3 100644 --- a/pkgs/browser_launcher/lib/src/chrome.dart +++ b/pkgs/browser_launcher/lib/src/chrome.dart @@ -9,15 +9,17 @@ import 'dart:io'; import 'package:path/path.dart' as p; import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; -const _chromeEnvironment = 'CHROME_EXECUTABLE'; +const _chromeEnvironments = ['CHROME_EXECUTABLE', 'CHROME_PATH']; const _linuxExecutable = 'google-chrome'; const _macOSExecutable = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'; const _windowsExecutable = r'Google\Chrome\Application\chrome.exe'; String get _executable { - if (Platform.environment.containsKey(_chromeEnvironment)) { - return Platform.environment[_chromeEnvironment]; + for (var chromeEnv in _chromeEnvironments) { + if (Platform.environment.containsKey(chromeEnv)) { + return Platform.environment[chromeEnv]; + } } if (Platform.isLinux) return _linuxExecutable; if (Platform.isMacOS) return _macOSExecutable; diff --git a/pkgs/browser_launcher/pubspec.yaml b/pkgs/browser_launcher/pubspec.yaml index 1d8367b20..186703f1a 100644 --- a/pkgs/browser_launcher/pubspec.yaml +++ b/pkgs/browser_launcher/pubspec.yaml @@ -1,7 +1,7 @@ name: browser_launcher description: Provides a standardized way to launch web browsers for testing and tools. -version: 0.1.8 +version: 0.1.9 homepage: https://github.com/dart-lang/browser_launcher