first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

6
node_modules/chromium-edge-launcher/.clang-format generated vendored Normal file
View File

@@ -0,0 +1,6 @@
---
BasedOnStyle: Google
Language: JavaScript
ColumnLimit: 100
ReflowComments: false
SpacesBeforeTrailingComments: 1

View File

@@ -0,0 +1,35 @@
name: 🛠
on:
push:
branches: [master]
pull_request: # run on all PRs, not just PRs to a particular branch
jobs:
basics:
runs-on: ubuntu-latest
strategy:
matrix:
# awaiting support for 'latest'/'lts'. https://github.com/actions/setup-node/issues/26
node: [ '10', '12', '14' ]
name: basics (node ${{ matrix.node }})
steps:
- name: git clone
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test-formatting
- run: yarn type-check
# Run tests that require headful Edge.
- run: sudo apt-get install xvfb
- name: yarn test
run: xvfb-run --auto-servernum yarn test --reporter=spec

202
node_modules/chromium-edge-launcher/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2014 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

190
node_modules/chromium-edge-launcher/README.md generated vendored Normal file
View File

@@ -0,0 +1,190 @@
# Edge Launcher [![NPM chromium-edge-launcher package](https://img.shields.io/npm/v/chromium-edge-launcher.svg)](https://npmjs.org/package/chromium-edge-launcher)
<img src="https://user-images.githubusercontent.com/4672033/107800563-adb9ce00-6d3d-11eb-8425-2256d0278894.png" align=right height=200>
Launch Microsoft Edge with ease from node.
* [Disables many Edge services](https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/src/flags.ts) that add noise to automated scenarios
* Opens up the browser's `remote-debugging-port` on an available port
* Automagically locates a Edge binary to launch
* Uses a fresh Edge profile for each launch, and cleans itself up on `kill()`
* Binds `Ctrl-C` (by default) to terminate the Edge process
* Exposes a small set of [options](#api) for configurability over these details
> _This project started as a fork of [Chrome Launcher](https://github.com/GoogleChrome/chrome-launcher) and inherits, whereas possible, all its features.
### Installing
```sh
yarn add chromium-edge-launcher
# or with npm:
npm install chromium-edge-launcher
```
## API
### `.launch([opts])`
#### Launch options
```js
{
// (optional) remote debugging port number to use. If provided port is already busy, launch() will reject
// Default: an available port is autoselected
port: number;
// (optional) Additional flags to pass to Edge, for example: ['--headless', '--disable-gpu']
// See: https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/docs/edge-flags-for-tools.md
// Do note, many flags are set by default: https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/src/flags.ts
edgeFlags: Array<string>;
// (optional) Close the Edge process on `Ctrl-C`
// Default: true
handleSIGINT: boolean;
// (optional) Explicit path of intended Edge binary
 // * If this `edgePath` option is defined, it will be used.
// * Otherwise, the `EDGE_PATH` env variable will be used if set. (`LIGHTHOUSE_CHROMIUM_PATH` is deprecated)
 // * Otherwise, a detected Edge Canary will be used if found
// * Otherwise, a detected Edge (stable) will be used
edgePath: string;
// (optional) Edge profile path to use, if set to `false` then the default profile will be used.
// By default, a fresh Edge profile will be created
userDataDir: string | boolean;
// (optional) Starting URL to open the browser with
// Default: `about:blank`
startingUrl: string;
// (optional) Logging level
// Default: 'silent'
logLevel: 'verbose'|'info'|'error'|'silent';
// (optional) Flags specific in [flags.ts](src/flags.ts) will not be included.
// Typically used with the defaultFlags() method and edgeFlags option.
// Default: false
ignoreDefaultFlags: boolean;
// (optional) Interval in ms, which defines how often launcher checks browser port to be ready.
// Default: 500
connectionPollInterval: number;
// (optional) A number of retries, before browser launch considered unsuccessful.
// Default: 50
maxConnectionRetries: number;
// (optional) A dict of environmental key value pairs to pass to the spawned edge process.
envVars: {[key: string]: string};
};
```
#### Launched edge interface
#### `.launch().then(edge => ...`
```js
// The remote debugging port exposed by the launched edge
edge.port: number;
// Method to kill Edge (and cleanup the profile folder)
edge.kill: () => Promise<void>;
// The process id
edge.pid: number;
// The childProcess object for the launched Edge
edge.process: childProcess
```
### `EdgeLauncher.Launcher.defaultFlags()`
Returns an `Array<string>` of the default [flags](docs/edge-flags-for-tools.md) Edge is launched with. Typically used along with the `ignoreDefaultFlags` and `edgeFlags` options.
Note: This array will exclude the following flags: `--remote-debugging-port` `--disable-setuid-sandbox` `--user-data-dir`.
### `EdgeLauncher.Launcher.getInstallations()`
Returns an `Array<string>` of paths to available Edge installations. When `edgePath` is not provided to `.launch()`, the first installation returned from this method is used instead.
Note: This method performs synchronous I/O operations.
### `.killAll()`
Attempts to kill all Edge instances created with [`.launch([opts])`](#launchopts). Returns a Promise that resolves to an array of errors that occurred while killing instances. If all instances were killed successfully, the array will be empty.
```js
const EdgeLauncher = require('chromium-edge-launcher');
async function cleanup() {
await EdgeLauncher.killAll();
}
```
## Examples
#### Launching edge:
```js
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com'
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
```
#### Launching headless edge:
```js
const EdgeLauncher = require('chromium-edge-launcher');
EdgeLauncher.launch({
startingUrl: 'https://google.com',
edgeFlags: ['--headless', '--disable-gpu']
}).then(edge => {
console.log(`Edge debugging port running on ${edge.port}`);
});
```
#### Launching with support for extensions and audio:
```js
const EdgeLauncher = require('chromium-edge-launcher');
const newFlags = EdgeLauncher.Launcher.defaultFlags().filter(flag => flag !== '--disable-extensions' && flag !== '--mute-audio');
EdgeLauncher.launch({
ignoreDefaultFlags: true,
edgeFlags: newFlags,
}).then(edge => { ... });
```
### Continuous Integration
In a CI environment like Travis, Edge may not be installed. If you want to use `chromium-edge-launcher`, Travis can [install Edge at run time with an addon](https://docs.travis-ci.com/user/edge). Alternatively, you can also install Edge using the [`download-edge.sh`](https://raw.githubusercontent.com/cezaraugusto/chromium-edge-launcher/v0.8.0/scripts/download-edge.sh) script.
Then in `.travis.yml`, use it like so:
```yaml
language: node_js
install:
- yarn install
before_script:
- export DISPLAY=:99.0
- export CHROME_PATH="$(pwd)/edge-linux/edge"
- sh -e /etc/init.d/xvfb start
- sleep 3 # wait for xvfb to boot
addons:
edge: stable
```
### Acknowledgements
This project started as a fork of, and is inspired by https://github.com/cezaraugusto/chromium-edge-launcher which is released under the Apache-2.0 License, and is copyright of Google Inc. Original contributors and git commit history kept as-is after the fork.

148
node_modules/chromium-edge-launcher/changelog.md generated vendored Normal file
View File

@@ -0,0 +1,148 @@
## v0.13.4 (Tue, Jul 7 2020)
* `08406b28` fix: preserve existing getInstallations output
* `f3669f45` perf: check default paths first when running on Mac (#209)
* `aef94948` docs: update defaultFlags() example for new API (#205)
## v0.13.3 (Thu, Jun 4 2020)
* `6a5d0c72` flags: disable background tracing (#203)
* `d9154291` chore(deps): update typescript and types (#202)
* `88e49686` test: use strict version of assert functions (#201)
## v0.13.2 (Thu, May 7 2020)
* `7c1ea547` deps: bump to is-wsl@2.2.0 (#187)
* `2ae5591d` fix: sanitize environment variables used in RegExp (#197)
## v0.13.1 (Wed, Apr 1 2020)
* `bf2957ac` deps: update various dependencies (#192)
## v0.13.0 (Thu, Feb 27 2020)
* `83da1e41` feat: add killAll function (#186)
* `b8c89f84` flags: disable the default browser check (#181) (#182)
* `6112555c` fix: log taskkill error based on logging opts (#178) (#179)
* `7c935efa` docs: add missing quote in README.md example (#180)
* `2e829c7d` Skip --disable-setuid-sandbox flag when ignoreDefaultFlags = true (#171)
## v0.12.0 (Wed, Oct 30 2019)
* `66a5e226` flags: add new --disable flags to reduce noise and disable backgrounding (#170)
- --disable-component-extensions-with-background-pages
- --disable-backgrounding-occluded-windows
- --disable-renderer-backgrounding
- --disable-background-timer-throttling
* `c4890ee3` feat: expose public interface for locating Chrome installations (#177)
- `Launcher.getInstallations()` returns an array of paths to available Chrome binaries
* `a5ccaa4e` deps: update assorted dependencies (#175)
* `e67a10df` --disable-translation is now --disable-features=TranslateUI (#167)
## v0.11.2 (Mon, Jul 29 2019)
* `1928187` fix: prevent mutation of default flags (#162)
* `02a23c2` docs: fix launcher example in README (#160)
* `90dc0e4` update manual-chrome-launcher with fixes from LH
## v0.11.1 (Tue, Jul 09 2019)
* `ec80f0ca` tests: drop support for node 9. continue supporting node 8 LTS (#159)
* `4865f3af` deps(security): bump mocha to latest (#158)
* `e0d2b09b` deps(security): bump handlebars from 4.0.11 to 4.1.2 (#157)
* `982be53f` update changelog for v0.10.7 and v0.11.0
## v0.11.0 (Tue, Jul 09 2019)
* `a860504f` [Breaking change] remove enableExtensions. add ignoreDefaultFlags & defaultFlags() (#124)
* `448a1d48` chrome-finder: Add support for MacOS Catalina (#149)
* `55b891bb` deps(is-wsl): add support for WSL 2; drop Node 6 (#152)
* `57e18181` deps: upgrade typescript and ts-node (#155)
* `a8848116` deps(security): bump lodash from 4.17.4 to 4.17.11 (#147)
* `0a775dab` Document that --enable-automation disables automatic page reloads (#140)
* `c9f653e2` Removing dead --safebrowsing-disable-auto-update flag. (#139)
* `be12d564` yarn.lock add integrity
* `e361aa43` Update changelog.md (#137)
## v0.10.7 (Wed, May 01 2019)
* `55397e0c` deps: update yarn.lock from #142
* `179a3f33` silence grep (#138)
* `d2f6037a` fix: move unneeded ts types to devDeps (#142)
* `984d61ce` docs(flags): remove a few flags that are gone.
* `6316362c` docs: fix link to chrome-launcher's flags (#128)
* `f1f6d162` Update chrome-flags-for-tools.md
## v0.10.5 (Tue, Sep 25 2018)
* `1328319b` fix: set the `which` command's stdio to pipe (#125)
## v0.10.4 (Mon, Sep 17 2018)
* `35842ba4` fix: ignore stdio on `which` call (#121)
* `f126c3a0` fix: reject promise on failed kill() (#112)
* `5ee0fde2` Set custom error codes for all errors.
* `841bdf3f` Fix picking CHROME_PATH priority over other matches.
* `6b10d748` Fix Travis CI build: GCE for chrome bug (#87)
* `d4aa8295` Fix readme's default logLevel (#85)
* `5be71243` Type improvements (#102)
* `dd5fdd49` Stricter typing for logLevel (#105)
* `c9394cf7` Fix README typo: booelan ==> boolean (#104)
* Update chrome-flags-for-tools.md
## v0.10.3 (Mon, Sep 17 2018)
Bad release. Had a breaking change (#70). Unpublished.
## v0.10.2 (Mon, Jan 8 2018)
* `ef91605f` Fix TS typing (#82)
* `baf2205f` tests(travis): test on Node 9, drop testing on Node 7 (#80)
## v0.10.1 (Fri, Jan 5 2018)
* `a5bc8180` Fix getLocalAppDataPath for wsl (#75)
* `70a91885` readme: recommend use of cri with chrome-launcher (#78)
* `d3ee63bd` folder refactor: ts in /src, js in /dist (#69)
## 0.10.0 (Fri, Dec 8 2017)
* `449c5238` Expose launched chrome child process object. (#67)
* `0978891c` Enable users to pass env vars into spawned chrome. (#66)
* `0261f43b` Add document covering the various chrome flags
* `5617473c` Make launcher the default export. (#63)
* `483acff5` fix: support alpine linux by retrying grep with -r (#61)
* `eaa0bb87` docs: update maxConnectionRetries default to 50 (#58)
## 0.9.0 (Mon, 27 Nov 2017)
* `4cc9c075` New: Add `userDataDir` flag to use default user profile instead (#48)
* `94137051` Avoid selecting google-emacs (#35)
## 0.8.0 (Wed, 20 Sept 2017)
* `256399c` Add support for Windows Subsystem for Linux / BashOnWindows (#27)
## 0.7.0 (Thu, 14 Sept 2017)
* Project moved to its own repo: https://github.com/GoogleChrome/chrome-launcher
* `8d0766eb` Retry connection for longer (#21)
* `52cb50af` only include PROGRAMFILES(X86) if present (#20)
* `530822b9` log pid to kill (#22)
* `1d617ab3` add support for `connectionPollInterval ` and `maxConnectionRetries` (#19)
* `7474971f` Fix errors inside spawnPromise being ignored (https://github.com/GoogleChrome/lighthouse/pull/2939)
## 0.6.0 (Thu, 17 Aug 2017)
* `43baee69` mute any audio (#3028)
* `ae6e9551` Better SIGINT handling (#2959)
* `3ab3a117` docs: add changelog to launcher (#2987)
## 0.5.0 (Mon, 14 Aug 2017)
* `494f9911` clarify priority of chromePath options
* `1c11021a` add support for finding Chromium on Linux (#2950)
* `391e2043` Publish type definitions instead of source TypeScript files (#2898)
* `de408ad3` readme: update example using deprecated `LIGHTHOUSE_CHROMIUM_PATH` (#2929)
* `8bc6d18e` add license file to launcher package. (#2849)
## 0.4.0 (Tue, 1 Aug 2017)
* `37fd38ce` pass --enable-extensions on from manual-chrome-launcher (#2735)
* `c942d17e` support enabling extension loading (#2650)
## 0.3.2 (Wed, 19 Jul 2017)
* `112c2c7f` Fix chrome finder on linux/osx when process.env isn't populated (#2687)
* `5728695f` Added CHROME_PATH to readme (#2694)
* `fedc76a3` test: fix clang-format error (#2691)
* `a6bbcaba` nuke 'as string'
* `41df647f` cli: remove --select-chrome,--skip-autolaunch. Support CHROME_PATH env (#2659)
* `8c9724e2` fix launcher w/ arbitrary flags (#2670)
* `9c0c0788` Expose LHR to modules consuming cli/run.ts (#2654)
* `6df6b0e2` support custom port via chrome-debug binary (#2644)
* `3f143b19` log the specific chrome spawn command.
## 0.3.1 (Wed, 5 Jul 2017)
* `ef081063` upgrade rimraf to latest (#2641)
## 0.3.0 (Fri, 30 Jun 2017)
* `edbb40d9` fix(driver): move performance observer registration to setupDriver (#2611)

View File

@@ -0,0 +1,4 @@
// This provides legacy support for a previously documented require pattern
// const edgeLauncher = require('chromium-edge-launcher/chromium-edge-launcher');
module.exports = require('../');

13
node_modules/chromium-edge-launcher/compiled-check.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
'use strict'
const fs = require('fs');
const path = require('path');
module.exports = function(filename) {
if (!fs.existsSync(path.join(__dirname, filename))) {
console.log(
'Oops! Looks like the chromium-edge-launcher files needs to be compiled. Please run:');
console.log(' yarn; yarn build;');
process.exit(1);
}
}

View File

@@ -0,0 +1,14 @@
/**
* check for MacOS default app paths first to avoid waiting for the slow lsregister command
*/
export declare function darwinFast(): string | undefined;
export declare function darwin(): string[];
/**
* Look for linux executables in 3 ways
* 1. Look into EDGE_PATH env variable
* 2. Look into the directories where .desktop are saved on gnome based distro's
* 3. Look for microsoft-edge-stable & microsoft-edge executables by using the which command
*/
export declare function linux(): string[];
export declare function wsl(): string[];
export declare function win32(): string[];

228
node_modules/chromium-edge-launcher/dist/edge-finder.js generated vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,72 @@
/// <reference types="node" />
import * as childProcess from 'child_process';
import * as fs from 'fs';
import { ChildProcess } from 'child_process';
export declare type RimrafModule = (path: string, callback: (error: Error) => void) => void;
export interface Options {
startingUrl?: string;
edgeFlags?: Array<string>;
port?: number;
handleSIGINT?: boolean;
edgePath?: string;
userDataDir?: string | boolean;
logLevel?: 'verbose' | 'info' | 'error' | 'silent';
ignoreDefaultFlags?: boolean;
connectionPollInterval?: number;
maxConnectionRetries?: number;
envVars?: {
[key: string]: string | undefined;
};
}
export interface LaunchedEdge {
pid: number;
port: number;
process: ChildProcess;
kill: () => Promise<void>;
}
export interface ModuleOverrides {
fs?: typeof fs;
rimraf?: RimrafModule;
spawn?: typeof childProcess.spawn;
}
declare function launch(opts?: Options): Promise<LaunchedEdge>;
declare function killAll(): Promise<Array<Error>>;
declare class Launcher {
private opts;
private tmpDirandPidFileReady;
private pidFile;
private startingUrl;
private outFile?;
private errFile?;
private edgePath?;
private ignoreDefaultFlags?;
private edgeFlags;
private requestedPort?;
private connectionPollInterval;
private maxConnectionRetries;
private fs;
private rimraf;
private spawn;
private useDefaultProfile;
private envVars;
edge?: childProcess.ChildProcess;
userDataDir?: string;
port?: number;
pid?: number;
constructor(opts?: Options, moduleOverrides?: ModuleOverrides);
private get flags();
static defaultFlags(): string[];
/** Returns the highest priority edge installation. */
static getFirstInstallation(): string | undefined;
makeTmpDir(): string;
prepare(): void;
launch(): Promise<void>;
private spawnProcess;
private cleanup;
private isDebuggerReady;
waitUntilReady(): Promise<void>;
kill(): Promise<void>;
destroyTmp(): Promise<void>;
}
export default Launcher;
export { Launcher, launch, killAll };

File diff suppressed because one or more lines are too long

1
node_modules/chromium-edge-launcher/dist/flags.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare const DEFAULT_FLAGS: ReadonlyArray<string>;

51
node_modules/chromium-edge-launcher/dist/flags.js generated vendored Normal file
View File

@@ -0,0 +1,51 @@
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_FLAGS = void 0;
// https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/docs/edge-flags-for-tools.md
exports.DEFAULT_FLAGS = [
// Disable built-in Google Translate service
'--disable-features=Translate',
// Disable all edge extensions
'--disable-extensions',
// Disable some extensions that aren't affected by --disable-extensions
'--disable-component-extensions-with-background-pages',
// Disable various background network services, including extension updating,
// safe browsing service, upgrade detector, translate, UMA
'--disable-background-networking',
// Don't update the browser 'components' listed at edge://components/
'--disable-component-update',
// Disables client-side phishing detection.
'--disable-client-side-phishing-detection',
// Disable syncing to a Google account
'--disable-sync',
// Disable reporting to UMA, but allows for collection
'--metrics-recording-only',
// Disable installation of default apps on first run
'--disable-default-apps',
// Mute any audio
'--mute-audio',
// Disable the default browser check, do not prompt to set it as such
'--no-default-browser-check',
// Skip first run wizards
'--no-first-run',
// Disable backgrounding renders for occluded windows
'--disable-backgrounding-occluded-windows',
// Disable renderer process backgrounding
'--disable-renderer-backgrounding',
// Disable task throttling of timer tasks from background pages.
'--disable-background-timer-throttling',
// Disable the default throttling of IPC between renderer & browser processes.
'--disable-ipc-flooding-protection',
// Avoid potential instability of using Gnome Keyring or KDE wallet. crbug.com/571003 crbug.com/991424
'--password-store=basic',
// Use mock keychain on Mac to prevent blocking permissions dialogs
'--use-mock-keychain',
// Disable background tracing (aka slow reports & deep reports) to avoid 'Tracing already started'
'--force-fieldtrials=*BackgroundTracing/default/',
];
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmxhZ3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZmxhZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILFlBQVksQ0FBQzs7O0FBRWIsa0dBQWtHO0FBRXJGLFFBQUEsYUFBYSxHQUEwQjtJQUNsRCw0Q0FBNEM7SUFDNUMsOEJBQThCO0lBQzlCLDhCQUE4QjtJQUM5QixzQkFBc0I7SUFDdEIsdUVBQXVFO0lBQ3ZFLHNEQUFzRDtJQUN0RCw2RUFBNkU7SUFDN0UsNERBQTREO0lBQzVELGlDQUFpQztJQUNqQyxxRUFBcUU7SUFDckUsNEJBQTRCO0lBQzVCLDJDQUEyQztJQUMzQywwQ0FBMEM7SUFDMUMsc0NBQXNDO0lBQ3RDLGdCQUFnQjtJQUNoQixzREFBc0Q7SUFDdEQsMEJBQTBCO0lBQzFCLG9EQUFvRDtJQUNwRCx3QkFBd0I7SUFDeEIsaUJBQWlCO0lBQ2pCLGNBQWM7SUFDZCxxRUFBcUU7SUFDckUsNEJBQTRCO0lBQzVCLHlCQUF5QjtJQUN6QixnQkFBZ0I7SUFDaEIscURBQXFEO0lBQ3JELDBDQUEwQztJQUMxQyx5Q0FBeUM7SUFDekMsa0NBQWtDO0lBQ2xDLGdFQUFnRTtJQUNoRSx1Q0FBdUM7SUFDdkMsOEVBQThFO0lBQzlFLG1DQUFtQztJQUNuQyxzR0FBc0c7SUFDdEcsd0JBQXdCO0lBQ3hCLG1FQUFtRTtJQUNuRSxxQkFBcUI7SUFDckIsa0dBQWtHO0lBQ2xHLGlEQUFpRDtDQUNsRCxDQUFDIn0=

1
node_modules/chromium-edge-launcher/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './edge-launcher';

14
node_modules/chromium-edge-launcher/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./edge-launcher"), exports);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsa0RBQWdDIn0=

View File

@@ -0,0 +1,4 @@
/**
* Return a random, unused port.
*/
export declare function getRandomPort(): Promise<number>;

View File

@@ -0,0 +1,25 @@
/**
* @license Copyright 2016 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRandomPort = void 0;
const http_1 = require("http");
/**
* Return a random, unused port.
*/
function getRandomPort() {
return new Promise((resolve, reject) => {
const server = http_1.createServer();
server.listen(0);
server.once('listening', () => {
const { port } = server.address();
server.close(() => resolve(port));
});
server.once('error', reject);
});
}
exports.getRandomPort = getRandomPort;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFuZG9tLXBvcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcmFuZG9tLXBvcnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILFlBQVksQ0FBQzs7O0FBRWIsK0JBQWtDO0FBR2xDOztHQUVHO0FBQ0gsU0FBZ0IsYUFBYTtJQUMzQixPQUFPLElBQUksT0FBTyxDQUFDLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBRSxFQUFFO1FBQ3JDLE1BQU0sTUFBTSxHQUFHLG1CQUFZLEVBQUUsQ0FBQztRQUM5QixNQUFNLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ2pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLEdBQUcsRUFBRTtZQUM1QixNQUFNLEVBQUMsSUFBSSxFQUFDLEdBQUcsTUFBTSxDQUFDLE9BQU8sRUFBaUIsQ0FBQztZQUMvQyxNQUFNLENBQUMsS0FBSyxDQUFDLEdBQUcsRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDO1FBQ3BDLENBQUMsQ0FBQyxDQUFDO1FBQ0gsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDL0IsQ0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDO0FBVkQsc0NBVUMifQ==

33
node_modules/chromium-edge-launcher/dist/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
export declare const enum LaunchErrorCodes {
ERR_LAUNCHER_PATH_NOT_SET = "ERR_LAUNCHER_PATH_NOT_SET",
ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY = "ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY",
ERR_LAUNCHER_UNSUPPORTED_PLATFORM = "ERR_LAUNCHER_UNSUPPORTED_PLATFORM",
ERR_LAUNCHER_NOT_INSTALLED = "ERR_LAUNCHER_NOT_INSTALLED"
}
export declare function defaults<T>(val: T | undefined, def: T): T;
export declare function delay(time: number): Promise<unknown>;
export declare class LauncherError extends Error {
message: string;
code?: string | undefined;
constructor(message?: string, code?: string | undefined);
}
export declare class EdgePathNotSetError extends LauncherError {
message: string;
code: LaunchErrorCodes;
}
export declare class InvalidUserDataDirectoryError extends LauncherError {
message: string;
code: LaunchErrorCodes;
}
export declare class UnsupportedPlatformError extends LauncherError {
message: string;
code: LaunchErrorCodes;
}
export declare class EdgeNotInstalledError extends LauncherError {
message: string;
code: LaunchErrorCodes;
}
export declare function getPlatform(): "aix" | "android" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "cygwin" | "netbsd" | "wsl";
export declare function makeTmpDir(): string;
export declare function toWinDirFormat(dir?: string): string;
export declare function getLocalAppDataPath(path: string): string;

120
node_modules/chromium-edge-launcher/dist/utils.js generated vendored Normal file
View File

@@ -0,0 +1,120 @@
/**
* @license Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocalAppDataPath = exports.toWinDirFormat = exports.makeTmpDir = exports.getPlatform = exports.EdgeNotInstalledError = exports.UnsupportedPlatformError = exports.InvalidUserDataDirectoryError = exports.EdgePathNotSetError = exports.LauncherError = exports.delay = exports.defaults = void 0;
const path_1 = require("path");
const child_process_1 = require("child_process");
const mkdirp = require("mkdirp");
const isWsl = require("is-wsl");
function defaults(val, def) {
return typeof val === 'undefined' ? def : val;
}
exports.defaults = defaults;
function delay(time) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise(resolve => setTimeout(resolve, time));
});
}
exports.delay = delay;
class LauncherError extends Error {
constructor(message = 'Unexpected error', code) {
super();
this.message = message;
this.code = code;
this.stack = new Error().stack;
return this;
}
}
exports.LauncherError = LauncherError;
class EdgePathNotSetError extends LauncherError {
constructor() {
super(...arguments);
this.message = 'The EDGE_PATH environment variable must be set to a Edge/Chromium executable no older than Edge stable.';
this.code = "ERR_LAUNCHER_PATH_NOT_SET" /* ERR_LAUNCHER_PATH_NOT_SET */;
}
}
exports.EdgePathNotSetError = EdgePathNotSetError;
class InvalidUserDataDirectoryError extends LauncherError {
constructor() {
super(...arguments);
this.message = 'userDataDir must be false or a path.';
this.code = "ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY" /* ERR_LAUNCHER_INVALID_USER_DATA_DIRECTORY */;
}
}
exports.InvalidUserDataDirectoryError = InvalidUserDataDirectoryError;
class UnsupportedPlatformError extends LauncherError {
constructor() {
super(...arguments);
this.message = `Platform ${getPlatform()} is not supported.`;
this.code = "ERR_LAUNCHER_UNSUPPORTED_PLATFORM" /* ERR_LAUNCHER_UNSUPPORTED_PLATFORM */;
}
}
exports.UnsupportedPlatformError = UnsupportedPlatformError;
class EdgeNotInstalledError extends LauncherError {
constructor() {
super(...arguments);
this.message = 'No Edge installations found.';
this.code = "ERR_LAUNCHER_NOT_INSTALLED" /* ERR_LAUNCHER_NOT_INSTALLED */;
}
}
exports.EdgeNotInstalledError = EdgeNotInstalledError;
function getPlatform() {
return isWsl ? 'wsl' : process.platform;
}
exports.getPlatform = getPlatform;
function makeTmpDir() {
switch (getPlatform()) {
case 'darwin':
case 'linux':
return makeUnixTmpDir();
case 'wsl':
// We populate the user's Windows temp dir so the folder is correctly created later
process.env.TEMP = getLocalAppDataPath(`${process.env.PATH}`);
case 'win32':
return makeWin32TmpDir();
default:
throw new UnsupportedPlatformError();
}
}
exports.makeTmpDir = makeTmpDir;
function toWinDirFormat(dir = '') {
const results = /\/mnt\/([a-z])\//.exec(dir);
if (!results) {
return dir;
}
const driveLetter = results[1];
return dir.replace(`/mnt/${driveLetter}/`, `${driveLetter.toUpperCase()}:\\`)
.replace(/\//g, '\\');
}
exports.toWinDirFormat = toWinDirFormat;
function getLocalAppDataPath(path) {
const userRegExp = /\/mnt\/([a-z])\/Users\/([^\/:]+)\/AppData\//;
const results = userRegExp.exec(path) || [];
return `/mnt/${results[1]}/Users/${results[2]}/AppData/Local`;
}
exports.getLocalAppDataPath = getLocalAppDataPath;
function makeUnixTmpDir() {
return child_process_1.execSync('mktemp -d -t lighthouse.XXXXXXX').toString().trim();
}
function makeWin32TmpDir() {
const winTmpPath = process.env.TEMP || process.env.TMP ||
(process.env.SystemRoot || process.env.windir) + '\\temp';
const randomNumber = Math.floor(Math.random() * 9e7 + 1e7);
const tmpdir = path_1.join(winTmpPath, 'lighthouse.' + randomNumber);
mkdirp.sync(tmpdir);
return tmpdir;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7R0FJRztBQUNILFlBQVksQ0FBQzs7Ozs7Ozs7Ozs7O0FBRWIsK0JBQTBCO0FBQzFCLGlEQUF1QztBQUN2Qyxp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BRyxXQUFJLENBQUMsVUFBVSxFQUFFLGFBQWEsR0FBRyxZQUFZLENBQUMsQ0FBQztJQUU5RCxNQUFNLENBQUMsSUFBSSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0lBQ3BCLE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUMifQ==

View File

@@ -0,0 +1,139 @@
# Edge Flags for Tooling
Many tools maintain a list of runtime flags for Edge to configure the environment. This file
is an attempt to document all edge flags that are relevant to tools, automation, benchmarking, etc.
All use cases are different, so you'll have to choose which flags are most appropriate.
## Commonly unwanted browser features
* `--disable-client-side-phishing-detection`: Disables client-side phishing detection
* `--disable-component-extensions-with-background-pages`: Disable some built-in extensions that aren't affected by `--disable-extensions`
* `--disable-default-apps`: Disable installation of default apps
* `--disable-extensions`: Disable all edge extensions
* `--mute-audio`: Mute any audio
* `--no-default-browser-check`: Disable the default browser check, do not prompt to set it as such
* `--no-first-run`: Skip first run wizards
* `--use-fake-device-for-media-stream`: Use fake device for Media Stream to replace camera and microphone
* `--use-file-for-fake-video-capture=<path-to-file>`: Use file for fake video capture (.y4m or .mjpeg) Needs `--use-fake-device-for-media-stream`
## Performance & web platform behavior
* `--allow-running-insecure-content`
* `--autoplay-policy=user-gesture-required`: Don't render video
* `--disable-background-timer-throttling`: Disable timers being throttled in background pages/tabs
* `--disable-backgrounding-occluded-windows`
* `--disable-features=ScriptStreaming`: V8 script streaming
* `--disable-hang-monitor`
* `--disable-ipc-flooding-protection`: Some javascript functions can be used to flood the browser process with IPC. By default, protection is on to limit the number of IPC sent to 10 per second per frame. This flag disables it. https://crrev.com/604305
* `--disable-notifications`: Disables the Web Notification and the Push APIs.
* `--disable-popup-blocking`: Disable popup blocking. `--block-new-web-contents` is the strict version of this.
* `--disable-prompt-on-repost`: Reloading a page that came from a POST normally prompts the user.
* `--disable-renderer-backgrounding`: This disables non-foreground tabs from getting a lower process priority This doesn't (on its own) affect timers or painting behavior. [karma-chromium-edge-launcher#123](https://github.com/karma-runner/karma-chromium-edge-launcher/issues/123)
* `--js-flags=--random-seed=1157259157`: Initialize V8's RNG with a fixed seed.
## Test & debugging flags
* `--disable-device-discovery-notifications`: Avoid messages like "New printer on your network"
* `--enable-automation`: Disable a few things considered not appropriate for automation. ([Original design doc](https://docs.google.com/a/google.com/document/d/1JYj9K61UyxIYavR8_HATYIglR9T_rDwAtLLsD3fbDQg/preview), though renamed [here](https://codereview.chromium.org/2564973002#msg24)) [codesearch](https://cs.chromium.org/search/?q=kEnableAutomation&type=cs). Note that some projects have chosen to **avoid** using this flag: [web-platform-tests/wpt/#6348](https://github.com/web-platform-tests/wpt/pull/6348)
- disables bubble notification about running development/unpacked extensions
- disables the password saving UI (which [covers](https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/password_manager/chrome_password_manager_client.cc;l=295-298;drc=00053fb4d880a925c890193b74a8ff35e1cef2a0) the usecase of the [removed](https://bugs.chromium.org/p/chromedriver/issues/detail?id=1015) `--disable-save-password-bubble` flag)
- disables infobar animations
- disables auto-reloading on network errors ([source](https://cs.chromium.org/chromium/src/chrome/renderer/net/net_error_helper_core.cc?l=917&rcl=6eaf0af71262eb876764c6237ee2fe021a3e7a18))
- means the default browser check prompt isn't shown
- avoids showing these 3 infobars: ShowBadFlagsPrompt, GoogleApiKeysInfoBarDelegate, ObsoleteSystemInfoBarDelegate
- adds this infobar: ![image](https://user-images.githubusercontent.com/39191/30349667-92a7a086-97c8-11e7-86b2-1365e3d407e3.png)
* `--enable-logging=stderr`: Logging behavior slightly more appropriate for a server-type process.
* `--log-level=0`: 0 means INFO and higher.
* `--password-store=basic`: Avoid potential instability of using Gnome Keyring or KDE wallet. [chromium/linux/password_storage.md](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/password_storage.md) https://crbug.com/571003
* `--remote-debugging-pipe`: more secure than using protocol over a websocket
* `--silent-debugger-extension-api`: Does not show an infobar when a Edge extension attaches to a page using `edge.debugger` page. Required to attach to extension background pages.
* `--test-type`: Basically the 2014 version of `--enable-automation`. [codesearch](https://cs.chromium.org/search/?q=kTestType%5Cb&type=cs)
- It avoids creating application stubs in ~/Applications on mac.
- It makes exit codes slightly more correct
- windows navigation jumplists arent updated https://crbug.com/389375
- doesn't start some edge StartPageService
- disables initializing chromecast service
- "Component extensions with background pages are not enabled during tests because they generate a lot of background behavior that can interfere."
- when quitting the browser, it disables additional checks that may stop that quitting process. (like unsaved form modifications or unhandled profile notifications..)
* `--use-mock-keychain`: Use mock keychain on Mac to prevent blocking permissions dialogs. https://crbug.com/865247
## Background updates, networking, reporting
* `--disable-background-networking`: Disable various background network services, including extension updating,safe browsing service, upgrade detector, translate, UMA
* `--disable-breakpad`: Disable crashdump collection (reporting is already disabled in Chromium)
* `--disable-component-update`: Don't update the browser 'components' listed at edge://components/
* `--disable-domain-reliability`: Disables Domain Reliability Monitoring, which tracks whether the browser has difficulty contacting Google-owned sites and uploads reports to Google.
* `--disable-sync`: Disable syncing to a Google account
* `--enable-crash-reporter-for-testing`: Used for turning on Breakpad crash reporting in a debug environment where crash reporting is typically compiled but disabled.
* `--metrics-recording-only`: Disable reporting to UMA, but allows for collection
## Rendering & GPU
* `--deterministic-mode`: An experimental meta flag. This sets the below indented flags which put the browser into a mode where rendering (border radius, etc) is deterministic and begin frames should be issued over DevTools Protocol. [codesearch](https://source.chromium.org/chromium/chromium/src/+/master:headless/app/headless_shell.cc;drc=df45d1abbc20abc7670643adda6d9625eea55b4d)
- `--run-all-compositor-stages-before-draw`
- `--disable-new-content-rendering-timeout`
- `--enable-begin-frame-control`
- `--disable-threaded-animation`
- `--disable-threaded-scrolling`
- `--disable-checker-imaging`
- `--disable-image-animation-resync`
* `--disable-features=PaintHolding`: Don't defer paint commits (normally used to avoid flash of unstyled content)
* `--disable-partial-raster`: https://crbug.com/919955
* `--disable-skia-runtime-opts`: Do not use runtime-detected high-end CPU optimizations in Skia.
* `--in-process-gpu`: Saves some memory by moving GPU process into a browser process thread
* `--use-gl="swiftshader"`: Select which implementation of GL the GPU process should use. Options are: `desktop`: whatever desktop OpenGL the user has installed (Linux and Mac default). `egl`: whatever EGL / GLES2 the user has installed (Windows default - actually ANGLE). `swiftshader`: The SwiftShader software renderer.
## Window & screen management
* `--block-new-web-contents`: All pop-ups and calls to window.open will fail.
* `--force-color-profile=srgb`: Force all monitors to be treated as though they have the specified color profile.
* `--force-device-scale-factor=1`
* `--new-window`: Launches URL in new browser window.
* `--window-position=0,0`
* `--window-size=1600,1024`
## Process management
* `--disable-features=site-per-process`: Disables OOPIF. https://www.chromium.org/Home/chromium-security/site-isolation
* `--process-per-tab`: [Doesn't do anything](https://source.chromium.org/chromium/chromium/src/+/master:content/public/common/content_switches.cc;l=602-605;drc=2149a93144ce2030ab20863c2983b6c9d7bfd177). Use --single-process instead.
* `--single-process`: Runs the renderer and plugins in the same process as the browser.
## Headless
* `--disable-dev-shm-usage`: Often used in Lambda, Cloud Functions scenarios. ([pptr issue](https://github.com/GoogleChrome/puppeteer/issues/1834), [crbug](https://bugs.chromium.org/p/chromium/issues/detail?id=736452))
* `--no-sandbox`: [Sometimes used](https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#setting-up-chrome-linux-sandbox) with headless, though not recommended.
* `--disable-gpu`: Sometimes [used](https://bugs.chromium.org/p/chromium/issues/detail?id=737678) with headless.
# ~Removed~ flags
* `--disable-add-to-shelf`: [Removed June 2017](https://codereview.chromium.org/2944283002)
* `--disable-background-downloads`: [Removed Oct 2014](https://codereview.chromium.org/607843002).
* `--disable-browser-side-navigation` Disabled PlzNavigate.
* `--disable-datasaver-prompt`
* `--disable-desktop-notifications`
* `--disable-features=TranslateUI`: renamed `TranslateUI` to `Translate` in [Sept 2020](https://chromium-review.googlesource.com/c/chromium/src/+/2404484).
* `--disable-infobars`: [Removed April 2014](https://codereview.chromium.org/240193003)
* `--disable-save-password-bubble`: [Removed May 2016](https://codereview.chromium.org/1978563002)
* `--disable-translate`: [Removed April 2017](https://codereview.chromium.org/2819813002/) Used to disable built-in Google Translate service.
* `--ignore-autoplay-restrictions`: [Removed December 2017](https://chromium-review.googlesource.com/#/c/816855/) Can use `--autoplay-policy=no-user-gesture-required` instead.
* `--safebrowsing-disable-auto-update`: [Removed Nov 2017](https://bugs.chromium.org/p/chromium/issues/detail?id=74848#c26)
# Sources
* [chromium-edge-launcher's flags](https://github.com/cezaraugusto/chromium-edge-launcher/blob/master/src/flags.ts)
* [Chromedriver's flags](https://cs.chromium.org/chromium/src/chrome/test/chromedriver/chrome_launcher.cc?type=cs&q=f:chrome_launcher++kDesktopSwitches&sq=package:chromium)
* [Puppeteer's flags](https://github.com/puppeteer/puppeteer/blob/main/src/node/Launcher.ts)
* [WebpageTest's flags](https://github.com/WPO-Foundation/wptagent/blob/master/internal/chrome_desktop.py)
* [Catapult's flags](https://source.chromium.org/search?q=f:catapult%20f:desktop%20symbol:GetBrowserStartupArgs&ss=chromium%2Fchromium%2Fsrc)
* [Karma's flags](https://github.com/karma-runner/karma-chromium-edge-launcher/blob/master/index.js)
# All Edge flags
* [The canonical list of Chrome command-line switches on peter.sh](http://peter.sh/experiments/chromium-command-line-switches/) (maintained by the Chromium team)
FYI: (Probably) all flags are defined in files matching the pattern of [`*_switches.cc`](f:_switches\.cc).
## Feature Flags FYI
Chromium and Blink use feature flags to disable/enable many features at runtime. Chromium has [~400 features](https://source.chromium.org/search?q=%22const%20base::Feature%22%20f:%5C.cc&sq=&ss=chromium%2Fchromium%2Fsrc) that can be toggled with `--enable-features` / `--disable-features`. Indepdently, Blink has [many features](https://source.chromium.org/chromium/chromium/src/+/master:out/Debug/gen/third_party/blink/renderer/platform/runtime_enabled_features.cc;l=1559;drc=170473ad887b7990079f1f996b126548569c5902) that can be toggled [with commandline switches](https://chromium.googlesource.com/chromium/src/+/master/third_party/blink/renderer/platform/RuntimeEnabledFeatures.md#command_line-switches): `--enable-blink-features` / `--disable-blink-features`.

52
node_modules/chromium-edge-launcher/manual-edge-launcher.js generated vendored Executable file
View File

@@ -0,0 +1,52 @@
#!/usr/bin/env node
'use strict';
// Keep this file in sync with lighthouse
// TODO: have LH depend on this one.
/**
* @fileoverview Script to launch a clean Edge instance on-demand.
*
* Assuming Lighthouse is installed globally or `npm link`ed, use via:
* edge-debug
* Optionally enable extensions or pass a port, additional edge flags, and/or a URL
* edge-debug --port=9222
* edge-debug http://goat.com
* edge-debug --show-paint-rects
* edge-debug --enable-extensions
*/
require('./compiled-check.js')('./dist/chromium-edge-launcher.js');
const {Launcher, launch} = require('./dist/chromium-edge-launcher');
const args = process.argv.slice(2);
const edgeFlags = [];
let startingUrl;
let port;
let ignoreDefaultFlags;
if (args.length) {
const providedFlags = args.filter(flag => flag.startsWith('--'));
const portFlag = providedFlags.find(flag => flag.startsWith('--port='));
if (portFlag) port = parseInt(portFlag.replace('--port=', ''), 10);
const enableExtensions = !!providedFlags.find(flag => flag === '--enable-extensions');
// The basic pattern for enabling Edge extensions
if (enableExtensions) {
ignoreDefaultFlags = true;
edgeFlags.push(...Launcher.defaultFlags().filter(flag => flag !== '--disable-extensions'));
}
edgeFlags.push(...providedFlags);
startingUrl = args.find(flag => !flag.startsWith('--'));
}
launch({
startingUrl,
port,
ignoreDefaultFlags,
edgeFlags,
})
// eslint-disable-next-line no-console
.then(v => console.log(`✨ Edge debugging port: ${v.port}`));

38
node_modules/chromium-edge-launcher/package.json generated vendored Normal file
View File

@@ -0,0 +1,38 @@
{
"name": "chromium-edge-launcher",
"main": "./dist/index.js",
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"test": "mocha --require ts-node/register --reporter=dot test/**/*-test.ts --timeout=10000",
"test-formatting": "test/check-formatting.sh",
"format": "scripts/format.sh",
"type-check": "tsc --allowJs --checkJs --noEmit --target es2016 *.js",
"prepublishOnly": "npm run build && npm run test"
},
"devDependencies": {
"@types/mkdirp": "^1.0.1",
"@types/mocha": "^8.0.4",
"@types/rimraf": "^3.0.0",
"@types/sinon": "^9.0.1",
"clang-format": "^1.0.50",
"mocha": "^8.2.1",
"sinon": "^9.0.1",
"ts-node": "^9.1.0",
"typescript": "^4.1.2"
},
"dependencies": {
"@types/node": "*",
"escape-string-regexp": "^4.0.0",
"is-wsl": "^2.2.0",
"lighthouse-logger": "^1.0.0",
"mkdirp": "^1.0.4",
"rimraf": "^3.0.2"
},
"version": "0.2.0",
"types": "./dist/index.d.ts",
"description": "Launch latest Edge with the Devtools Protocol port open",
"repository": "https://github.com/cezaraugusto/chromium-edge-launcher/",
"author": "Cezar Augusto",
"license": "Apache-2.0"
}

5
node_modules/chromium-edge-launcher/scripts/format.sh generated vendored Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
FILES="`find src -type f -name '*.ts'`"
./node_modules/.bin/clang-format -i -style=file $FILES

21
node_modules/chromium-edge-launcher/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,21 @@
{
"compilerOptions": {
"module": "commonjs",
"outDir": "dist",
"target": "es2016",
"declaration": true,
"noImplicitAny": true,
"inlineSourceMap": true,
"noEmitOnError": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"exclude": [
"node_modules"
],
"include": [
"src"
]
}