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

Merge package:browser_launcher #689

Merged
merged 67 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
be8b9aa
first commit
kenzieschmoll Apr 24, 2019
b36f3fa
Setup package skeleton for browser_launcher
kenzieschmoll Apr 24, 2019
e8124d4
small tweaks to readme and .gitignore (dart-lang/browser_launcher#2)
kevmoo Apr 24, 2019
a6ce764
Add travis badge to readme (dart-lang/browser_launcher#3)
kevmoo Apr 24, 2019
705313d
Add chrome launching code to browser_launcher (dart-lang/browser_laun…
kenzieschmoll Apr 26, 2019
1123d7f
Prepare browser_launcher for 0.1.0 release (dart-lang/browser_launche…
kenzieschmoll Apr 26, 2019
3e62c4e
Add example to improve pub score. (dart-lang/browser_launcher#6)
kenzieschmoll Apr 26, 2019
842d7b4
Prepare for 0.1.1 release. (dart-lang/browser_launcher#7)
kenzieschmoll Apr 26, 2019
1aae1f2
Change min sdk and prepare for release 0.1.2 (dart-lang/browser_launc…
kenzieschmoll Apr 29, 2019
276f56b
widen the version range on webkit_inspection_protocol (dart-lang/brow…
devoncarew Aug 14, 2019
810b852
rev to 0.1.3 (dart-lang/browser_launcher#11)
devoncarew Aug 23, 2019
2e67248
Return process from start() (dart-lang/browser_launcher#12)
DanTup Sep 5, 2019
7358e2a
Start Chrome maximized (dart-lang/browser_launcher#13)
grouma Sep 26, 2019
7013135
Allow passing in a user-data-dir (dart-lang/browser_launcher#14)
alan-knight Oct 21, 2019
eaf6c0c
Update lower SDK bound to 2.2.0 (dart-lang/browser_launcher#15)
kevmoo Jan 21, 2020
88e6bdb
widen the dep range on package:webkit_inspection_protocol (dart-lang/…
devoncarew May 13, 2020
16b9e73
rev to 0.1.7 (dart-lang/browser_launcher#18)
devoncarew May 19, 2020
559c143
Migrate to Github Actions (dart-lang/browser_launcher#21)
grouma Dec 3, 2020
e3f4395
Update badge (dart-lang/browser_launcher#22)
kevmoo Dec 4, 2020
cb4ab86
Only show CI results for master (dart-lang/browser_launcher#23)
grouma Dec 4, 2020
0e93231
Adding additional Chrome environment variables for executable resolut…
Markzipan Mar 18, 2021
874023a
Support latest webkit_inspection_protocol (dart-lang/browser_launcher…
grouma Mar 25, 2021
8140ac1
Update LICENSE
franklinyow Apr 1, 2021
723189a
Update CI bits (dart-lang/browser_launcher#26)
kevmoo Apr 23, 2021
bf3087d
Migrate browser_launcher to null-safety. (dart-lang/browser_launcher#27)
kenzieschmoll May 7, 2021
6b588f7
Move to pkg:lints (dart-lang/browser_launcher#28)
kevmoo Oct 20, 2021
b8aadc7
Allow signing into default profile and enabling extensions (dart-lang…
Jan 21, 2022
d9374a7
enable the avoid_dynamic_calls lint (dart-lang/browser_launcher#30)
devoncarew Feb 17, 2022
ad39f10
Update version (dart-lang/browser_launcher#31)
Mar 21, 2022
9934ace
Update pubspec.yaml (dart-lang/browser_launcher#32)
devoncarew Apr 19, 2022
dc9cb60
prep for publishing (dart-lang/browser_launcher#33)
devoncarew Jun 15, 2022
9463626
Update lints, require Dart 2.17, add dependabot (dart-lang/browser_la…
kevmoo Nov 1, 2022
0191084
Fix internal CI test failures (dart-lang/browser_launcher#35)
Dec 13, 2022
ae0d2ea
Bump actions/checkout from 3.1.0 to 3.2.0 (dart-lang/browser_launcher…
dependabot[bot] Jan 3, 2023
ed93e5e
Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/browser_launcher…
dependabot[bot] Feb 1, 2023
2344639
Bump dart-lang/setup-dart from 1.3 to 1.4 (dart-lang/browser_launcher…
dependabot[bot] Feb 1, 2023
b68ab87
Bump actions/checkout from 3.3.0 to 3.5.0 (dart-lang/browser_launcher…
dependabot[bot] Apr 4, 2023
3228262
Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (dart-lang/browser_laun…
dependabot[bot] Apr 4, 2023
2ad7f58
Disable test (dart-lang/browser_launcher#44)
elliette May 11, 2023
990caec
Bump actions/checkout from 3.5.0 to 3.5.2 (dart-lang/browser_launcher…
dependabot[bot] May 11, 2023
24a0153
blast_repo fixes (dart-lang/browser_launcher#45)
devoncarew May 12, 2023
1a99465
update formatting for recent lints (dart-lang/browser_launcher#47)
devoncarew Jul 5, 2023
6d5ac87
Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/browser_launcher…
dependabot[bot] Jul 5, 2023
d4c13c6
Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/browser_launcher…
dependabot[bot] Sep 1, 2023
af2bc2c
Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/browser_launcher…
dependabot[bot] Oct 1, 2023
84e3f15
Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/browser_laun…
dependabot[bot] Oct 3, 2023
7248b76
Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/browser_launcher…
dependabot[bot] Nov 1, 2023
c908ef3
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/browser_laun…
dependabot[bot] Nov 1, 2023
33b8c66
Update and fix lints, require Dart 3.0 (dart-lang/browser_launcher#53)
kevmoo Nov 9, 2023
2b05a66
drop outdated lints
kevmoo Dec 4, 2023
606134a
Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/browser_laun…
dependabot[bot] Feb 1, 2024
ee14d22
Add extra flags to disable throttling behavior. (dart-lang/browser_la…
sigmundch Feb 16, 2024
45d8578
Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/browser_launcher…
dependabot[bot] Apr 1, 2024
0e72faa
Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/browser_laun…
dependabot[bot] May 1, 2024
ea9fcad
Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/browser_launcher…
dependabot[bot] May 1, 2024
1e99a86
blast_repo fixes (dart-lang/browser_launcher#59)
devoncarew May 3, 2024
5d5082e
Bump actions/checkout from 4.1.4 to 4.1.6 in the github-actions group…
dependabot[bot] Jun 1, 2024
2ff8ff9
Bump the github-actions group with 2 updates (dart-lang/browser_launc…
dependabot[bot] Jul 1, 2024
8ed7db4
update lints (dart-lang/browser_launcher#62)
kevmoo Jul 8, 2024
2c690eb
Add --use-mock-keychain to Chrome args (dart-lang/browser_launcher#63)
srujzs Aug 22, 2024
7e49da4
Add CHANGELOG entry for https://github.com/dart-lang/browser_launcher…
srujzs Aug 22, 2024
dd6f222
Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group…
dependabot[bot] Oct 1, 2024
9df6358
Merge package:browser_launcher into the tools monorepo
mosuem Oct 25, 2024
82f509f
Add issue template and other fixes
mosuem Oct 25, 2024
81400d7
Moving fixes
mosuem Oct 25, 2024
96c7b01
Changes as per review
mosuem Oct 28, 2024
561291e
Remove lint rule
mosuem Oct 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/browser_launcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:browser_launcher"
about: "Create a bug or file a feature request against package:browser_launcher."
labels: "package:browser_launcher"
---
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/boolean_selector/**'

'package:browser_launcher':
- changed-files:
- any-glob-to-any-file: 'pkgs/browser_launcher/**'

'package:cli_config':
- changed-files:
- any-glob-to-any-file: 'pkgs/cli_config/**'
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/browser_launcher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: package:browser_launcher

on:
# Run on PRs and pushes to the default branch.
push:
branches: [ main ]
paths:
- '.github/workflows/browser_launcher.yml'
- 'pkgs/browser_launcher/**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/browser_launcher.yml'
- 'pkgs/browser_launcher/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github
DISPLAY: ':99'

defaults:
run:
working-directory: pkgs/browser_launcher/

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [3.4, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}

- run: dart pub get

- run: dart format --output=none --set-exit-if-changed .
- run: dart analyze --fatal-infos

- name: Run Xvfb
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &

- run: dart test
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ don't naturally belong to other topic monorepos (like
| Package | Description | Version |
| --- | --- | --- |
| [boolean_selector](pkgs/boolean_selector/) | A flexible syntax for boolean expressions, based on a simplified version of Dart's expression syntax. | [![pub package](https://img.shields.io/pub/v/boolean_selector.svg)](https://pub.dev/packages/boolean_selector) |
| [browser_launcher](pkgs/browser_launcher/) | Provides a standardized way to launch web browsers for testing and tools. | [![pub package](https://img.shields.io/pub/v/browser_launcher.svg)](https://pub.dev/packages/browser_launcher) |
| [cli_config](pkgs/cli_config/) | A library to take config values from configuration files, CLI arguments, and environment variables. | [![pub package](https://img.shields.io/pub/v/cli_config.svg)](https://pub.dev/packages/cli_config) |
| [coverage](pkgs/coverage/) | Coverage data manipulation and formatting. | [![pub package](https://img.shields.io/pub/v/coverage.svg)](https://pub.dev/packages/coverage) |
| [extension_discovery](pkgs/extension_discovery/) | A convention and utilities for package extension discovery. | [![pub package](https://img.shields.io/pub/v/extension_discovery.svg)](https://pub.dev/packages/extension_discovery) |
Expand Down
4 changes: 4 additions & 0 deletions pkgs/browser_launcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Don’t commit the following directories created by pub.
.dart_tool/
.packages
pubspec.lock
6 changes: 6 additions & 0 deletions pkgs/browser_launcher/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Below is a list of people and organizations that have contributed
# to the project. Names should be added to the list like so:
#
# Name/Organization <email address>

Google Inc.
71 changes: 71 additions & 0 deletions pkgs/browser_launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## 1.1.3

- Move to `dart-lang/tools` monorepo.

## 1.1.2

- Require Dart 3.4
- Log errors from chrome
- Allow tests to detect headless-only environment (for CI).
- Add extra flags that may help disable additional throttling in background tabs
- Add `--use-mock-keychain` flag to avoid blocking dialog on MacOS.

## 1.1.1

- Populate the pubspec `repository` field.

## 1.1.0

- Add optional `signIn` argument to `startWithDebugPort`.
To be used together with `user-data-dir` to start a Chrome
window signed in to the default profile with extensions enabled.
- Enable the `avoid_dynamic_calls` lint.

## 1.0.0

- Migrate to null-safety.

## 0.1.10

- Support `webkit_inspection_protocol` version `^1.0.0`.

## 0.1.9

- Add support for Chrome executables in `CHROME_PATH`.

## 0.1.8

- Log `STDERR` on Chrome launch failure.

## 0.1.7

- Widen the dependency range on `package:webkit_inspection_protocol`.

## 0.1.6

- Update lower Dart SDK requirement to `2.2.0`.
- Update the dependency range on `package:webkit_inspection_protocol`.

## 0.1.5

- Add a parameter to use a specified user-data-dir instead of a system temp.

## 0.1.4

- Start Chrome maximized.

## 0.1.3

- widen the version constraint on `package:webkit_inspection_protocol`

## 0.1.2

- lower min sdk version to match Flutter stable

## 0.1.1

- added example

## 0.1.0

- initial release
27 changes: 27 additions & 0 deletions pkgs/browser_launcher/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2019, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8 changes: 8 additions & 0 deletions pkgs/browser_launcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[![Build Status](https://github.com/dart-lang/tools/actions/workflows/browser_launcher.yaml/badge.svg)](https://github.com/dart-lang/tools/actions/workflows/browser_launcher.yaml)
[![pub package](https://img.shields.io/pub/v/browser_launcher.svg)](https://pub.dev/packages/browser_launcher)
[![package publisher](https://img.shields.io/pub/publisher/browser_launcher.svg)](https://pub.dev/packages/browser_launcher/publisher)

Provides a standardized way to launch web browsers.

Currently, Chrome is the only supported browser; support for other browsers may
be added in the future.
32 changes: 32 additions & 0 deletions pkgs/browser_launcher/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://dart.dev/guides/language/analysis-options
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_classes_with_only_static_members
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_this
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- join_return_with_assignment
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- require_trailing_commas
- unnecessary_raw_strings
- use_if_null_to_convert_nulls_to_bools
- use_raw_strings
- use_string_buffers
31 changes: 31 additions & 0 deletions pkgs/browser_launcher/example/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:browser_launcher/browser_launcher.dart';
mosuem marked this conversation as resolved.
Show resolved Hide resolved

const _googleUrl = 'https://www.google.com/';
const _googleImagesUrl = 'https://www.google.com/imghp?hl=en';

Future<void> main() async {
// Launches a chrome browser with two tabs open to [_googleUrl] and
// [_googleImagesUrl].
await Chrome.start([_googleUrl, _googleImagesUrl]);
print('launched Chrome');

// Pause briefly before opening Chrome with a debug port.
await Future<void>.delayed(const Duration(seconds: 3));

// Launches a chrome browser open to [_googleUrl]. Since we are launching with
// a debug port, we will use a variety of different launch configurations,
// such as launching in a new browser.
final chrome = await Chrome.startWithDebugPort([_googleUrl], debugPort: 8888);
print('launched Chrome with a debug port');

// When running this dart code, observe that the browser stays open for 3
// seconds before we close it.
await Future<void>.delayed(const Duration(seconds: 3));

await chrome.close();
print('closed Chrome');
}
5 changes: 5 additions & 0 deletions pkgs/browser_launcher/lib/browser_launcher.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'src/chrome.dart';
Loading
Loading