mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: Add EsLint rule import/order (#9685)
This commit is contained in:
parent
e8e18ae081
commit
eefe9583d0
@ -110,6 +110,14 @@ module.exports = {
|
||||
],
|
||||
'import/extensions': ['error', 'ignorePackages'],
|
||||
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
'newlines-between': 'always',
|
||||
alphabetize: {order: 'asc', caseInsensitive: true},
|
||||
},
|
||||
],
|
||||
|
||||
'no-restricted-syntax': [
|
||||
'error',
|
||||
// Don't allow underscored declarations on camelCased variables/properties.
|
||||
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import yargs from 'yargs';
|
||||
import ProgressBar from 'progress';
|
||||
import yargs from 'yargs';
|
||||
import {hideBin} from 'yargs/helpers';
|
||||
|
||||
import {Browser, BrowserPlatform} from './browsers/types.js';
|
||||
import {fetch} from './fetch.js';
|
||||
|
||||
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Browser, BrowserPlatform} from './browsers/types.js';
|
||||
import path from 'path';
|
||||
|
||||
import {Browser, BrowserPlatform} from './browsers/types.js';
|
||||
|
||||
/**
|
||||
* The cache used by Puppeteer relies on the following structure:
|
||||
*
|
||||
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {BrowserPlatform} from './types.js';
|
||||
import path from 'path';
|
||||
|
||||
import {BrowserPlatform} from './types.js';
|
||||
|
||||
function archive(platform: BrowserPlatform, revision: string): string {
|
||||
switch (platform) {
|
||||
case BrowserPlatform.LINUX:
|
||||
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {BrowserPlatform} from './types.js';
|
||||
import path from 'path';
|
||||
|
||||
import {BrowserPlatform} from './types.js';
|
||||
|
||||
function archive(platform: BrowserPlatform, revision: string): string {
|
||||
switch (platform) {
|
||||
case BrowserPlatform.LINUX:
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
|
||||
import {BrowserPlatform} from './browsers/browsers.js';
|
||||
|
||||
export function detectBrowserPlatform(): BrowserPlatform | undefined {
|
||||
|
@ -14,18 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import {existsSync} from 'fs';
|
||||
import {mkdir, unlink} from 'fs/promises';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {debug} from './debug.js';
|
||||
import {Browser, BrowserPlatform, downloadUrls} from './browsers/browsers.js';
|
||||
import {downloadFile, headHttpRequest} from './httpUtil.js';
|
||||
import assert from 'assert';
|
||||
import {unpackArchive} from './fileUtil.js';
|
||||
import {detectBrowserPlatform} from './detectPlatform.js';
|
||||
import {CacheStructure} from './CacheStructure.js';
|
||||
import {debug} from './debug.js';
|
||||
import {detectBrowserPlatform} from './detectPlatform.js';
|
||||
import {unpackArchive} from './fileUtil.js';
|
||||
import {downloadFile, headHttpRequest} from './httpUtil.js';
|
||||
|
||||
const debugFetch = debug('puppeteer:browsers:fetcher');
|
||||
|
||||
|
@ -14,14 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as path from 'path';
|
||||
import {exec as execChildProcess} from 'child_process';
|
||||
import extractZip from 'extract-zip';
|
||||
import {createReadStream} from 'fs';
|
||||
import {mkdir, readdir} from 'fs/promises';
|
||||
import * as path from 'path';
|
||||
import {promisify} from 'util';
|
||||
|
||||
import extractZip from 'extract-zip';
|
||||
import tar from 'tar-fs';
|
||||
import bzip from 'unbzip2-stream';
|
||||
import {promisify} from 'util';
|
||||
|
||||
const exec = promisify(execChildProcess);
|
||||
|
||||
|
@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {createWriteStream} from 'fs';
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import {URL} from 'url';
|
||||
|
||||
import createHttpsProxyAgent from 'https-proxy-agent';
|
||||
import {getProxyForUrl} from 'proxy-from-env';
|
||||
import {createWriteStream} from 'fs';
|
||||
|
||||
export function headHttpRequest(url: URL): Promise<boolean> {
|
||||
return new Promise(resolve => {
|
||||
|
@ -14,15 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {
|
||||
Browser,
|
||||
BrowserPlatform,
|
||||
executablePathByBrowser,
|
||||
} from './browsers/browsers.js';
|
||||
import {detectBrowserPlatform} from './detectPlatform.js';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import {CacheStructure} from './CacheStructure.js';
|
||||
import {detectBrowserPlatform} from './detectPlatform.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import path from 'path';
|
||||
|
||||
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import {
|
||||
resolveDownloadUrl,
|
||||
relativeExecutablePath,
|
||||
} from '../../lib/cjs/browsers/chrome.js';
|
||||
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import assert from 'assert';
|
||||
import path from 'path';
|
||||
|
||||
describe('Chrome', () => {
|
||||
it('should resolve download URLs', () => {
|
||||
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {CLI} from '../../lib/cjs/CLI.js';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
import assert from 'assert';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {CLI} from '../../lib/cjs/CLI.js';
|
||||
|
||||
describe('CLI', function () {
|
||||
this.timeout(60000);
|
||||
|
@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {fetch, canFetch} from '../../lib/cjs/fetch.js';
|
||||
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
import assert from 'assert';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import {fetch, canFetch} from '../../lib/cjs/fetch.js';
|
||||
|
||||
/**
|
||||
* Tests in this spec use real download URLs and unpack live browser archives
|
||||
|
@ -14,13 +14,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
import path from 'path';
|
||||
|
||||
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import {
|
||||
relativeExecutablePath,
|
||||
resolveDownloadUrl,
|
||||
} from '../../lib/cjs/browsers/firefox.js';
|
||||
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import assert from 'assert';
|
||||
import path from 'path';
|
||||
|
||||
describe('Firefox', () => {
|
||||
it('should resolve download URLs', () => {
|
||||
|
@ -14,12 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {computeExecutablePath} from '../../lib/cjs/launcher.js';
|
||||
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
|
||||
import assert from 'assert';
|
||||
import path from 'path';
|
||||
|
||||
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
|
||||
import {computeExecutablePath} from '../../lib/cjs/launcher.js';
|
||||
|
||||
describe('launcher', () => {
|
||||
it('should compute executable path for Chrome', () => {
|
||||
assert.strictEqual(
|
||||
|
@ -1,3 +1,5 @@
|
||||
import {spawn} from 'child_process';
|
||||
|
||||
import {
|
||||
createBuilder,
|
||||
BuilderContext,
|
||||
@ -6,7 +8,6 @@ import {
|
||||
BuilderRun,
|
||||
} from '@angular-devkit/architect';
|
||||
import {JsonObject} from '@angular-devkit/core';
|
||||
import {spawn} from 'child_process';
|
||||
|
||||
import {PuppeteerBuilderOptions} from './types.js';
|
||||
|
||||
|
@ -16,14 +16,15 @@
|
||||
|
||||
import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics';
|
||||
import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks';
|
||||
|
||||
import {concatMap, map, scan} from 'rxjs/operators';
|
||||
import {of} from 'rxjs';
|
||||
import {concatMap, map, scan} from 'rxjs/operators';
|
||||
|
||||
import {
|
||||
addBaseFiles,
|
||||
addFrameworkFiles,
|
||||
getNgCommandName,
|
||||
} from '../utils/files.js';
|
||||
import {getAngularConfig} from '../utils/json.js';
|
||||
import {
|
||||
addPackageJsonDependencies,
|
||||
addPackageJsonScripts,
|
||||
@ -33,9 +34,7 @@ import {
|
||||
type NodePackage,
|
||||
updateAngularJsonScripts,
|
||||
} from '../utils/packages.js';
|
||||
|
||||
import {type SchematicsOptions} from '../utils/types.js';
|
||||
import {getAngularConfig} from '../utils/json.js';
|
||||
|
||||
// You don't have to export the function as default. You can also have more than one rule
|
||||
// factory per file.
|
||||
|
@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {relative, resolve} from 'path';
|
||||
|
||||
import {getSystemPath, normalize, strings} from '@angular-devkit/core';
|
||||
import {
|
||||
SchematicContext,
|
||||
@ -26,7 +28,7 @@ import {
|
||||
move,
|
||||
url,
|
||||
} from '@angular-devkit/schematics';
|
||||
import {relative, resolve} from 'path';
|
||||
|
||||
import {SchematicsOptions, TestingFramework} from './types.js';
|
||||
|
||||
export interface FilesOptions {
|
||||
|
@ -14,15 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Tree} from '@angular-devkit/schematics';
|
||||
import {get} from 'https';
|
||||
import {SchematicsOptions, TestingFramework} from './types.js';
|
||||
|
||||
import {Tree} from '@angular-devkit/schematics';
|
||||
|
||||
import {getNgCommandName, getScriptFromOptions} from './files.js';
|
||||
import {
|
||||
getAngularConfig,
|
||||
getJsonFileAsObject,
|
||||
getObjectAsJson,
|
||||
} from './json.js';
|
||||
import {getNgCommandName, getScriptFromOptions} from './files.js';
|
||||
import {SchematicsOptions, TestingFramework} from './types.js';
|
||||
export interface NodePackage {
|
||||
name: string;
|
||||
version: string;
|
||||
|
@ -1,12 +1,13 @@
|
||||
import expect from 'expect';
|
||||
import sinon from 'sinon';
|
||||
import https from 'https';
|
||||
import {join} from 'path';
|
||||
|
||||
import {JsonObject} from '@angular-devkit/core';
|
||||
import {
|
||||
SchematicTestRunner,
|
||||
UnitTestTree,
|
||||
} from '@angular-devkit/schematics/testing/schematic-test-runner';
|
||||
import {JsonObject} from '@angular-devkit/core';
|
||||
import expect from 'expect';
|
||||
import sinon from 'sinon';
|
||||
|
||||
const WORKSPACE_OPTIONS = {
|
||||
name: 'workspace',
|
||||
|
@ -17,11 +17,14 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
import {ChildProcess} from 'child_process';
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {EventEmitter} from '../common/EventEmitter.js';
|
||||
import type {Page} from './Page.js'; // TODO: move to ./api
|
||||
import type {Target} from '../common/Target.js'; // TODO: move to ./api
|
||||
|
||||
import type {BrowserContext} from './BrowserContext.js';
|
||||
import type {Page} from './Page.js'; // TODO: move to ./api
|
||||
|
||||
/**
|
||||
* BrowserContext options.
|
||||
|
@ -15,9 +15,10 @@
|
||||
*/
|
||||
|
||||
import {EventEmitter} from '../common/EventEmitter.js';
|
||||
import {Page} from './Page.js';
|
||||
import {Target} from '../common/Target.js';
|
||||
|
||||
import type {Permission, Browser} from './Browser.js';
|
||||
import {Page} from './Page.js';
|
||||
|
||||
/**
|
||||
* BrowserContexts provide a way to operate multiple independent browser
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {CDPSession} from '../common/Connection.js';
|
||||
import {ExecutionContext} from '../common/ExecutionContext.js';
|
||||
import {Frame} from '../common/Frame.js';
|
||||
@ -27,6 +28,7 @@ import {
|
||||
NodeFor,
|
||||
} from '../common/types.js';
|
||||
import {KeyInput} from '../common/USKeyboardLayout.js';
|
||||
|
||||
import {JSHandle} from './JSHandle.js';
|
||||
import {ScreenshotOptions} from './Page.js';
|
||||
|
||||
|
@ -15,9 +15,11 @@
|
||||
*/
|
||||
|
||||
import Protocol from 'devtools-protocol';
|
||||
|
||||
import {CDPSession} from '../common/Connection.js';
|
||||
import {ExecutionContext} from '../common/ExecutionContext.js';
|
||||
import {EvaluateFuncWith, HandleFor, HandleOr} from '../common/types.js';
|
||||
|
||||
import {ElementHandle} from './ElementHandle.js';
|
||||
|
||||
declare const __JSHandleSymbol: unique symbol;
|
||||
|
@ -14,8 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import type {Readable} from 'stream';
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {Accessibility} from '../common/Accessibility.js';
|
||||
import type {ConsoleMessage} from '../common/ConsoleMessage.js';
|
||||
import type {Coverage} from '../common/Coverage.js';
|
||||
@ -51,6 +53,7 @@ import type {
|
||||
NodeFor,
|
||||
} from '../common/types.js';
|
||||
import type {WebWorker} from '../common/WebWorker.js';
|
||||
|
||||
import type {Browser} from './Browser.js';
|
||||
import type {BrowserContext} from './BrowserContext.js';
|
||||
import type {ElementHandle} from './ElementHandle.js';
|
||||
|
@ -15,9 +15,11 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {CDPSession} from './Connection.js';
|
||||
|
||||
import {ElementHandle} from '../api/ElementHandle.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
|
||||
/**
|
||||
* Represents a Node and the properties of it that are relevant to Accessibility.
|
||||
* @public
|
||||
|
@ -19,6 +19,7 @@ import {Protocol} from 'devtools-protocol';
|
||||
import {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {QueryHandler, QuerySelector} from './QueryHandler.js';
|
||||
import {AwaitableIterable} from './types.js';
|
||||
|
@ -1,5 +1,6 @@
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
import {debugError} from './util.js';
|
||||
|
||||
|
@ -15,17 +15,9 @@
|
||||
*/
|
||||
|
||||
import {ChildProcess} from 'child_process';
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {CDPSession, Connection, ConnectionEmittedEvents} from './Connection.js';
|
||||
import {waitWithTimeout} from './util.js';
|
||||
import {Page} from '../api/Page.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {Target} from './Target.js';
|
||||
import {TaskQueue} from './TaskQueue.js';
|
||||
import {TargetManager, TargetManagerEmittedEvents} from './TargetManager.js';
|
||||
import {ChromeTargetManager} from './ChromeTargetManager.js';
|
||||
import {FirefoxTargetManager} from './FirefoxTargetManager.js';
|
||||
|
||||
import {
|
||||
Browser as BrowserBase,
|
||||
BrowserCloseCallback,
|
||||
@ -39,6 +31,17 @@ import {
|
||||
Permission,
|
||||
} from '../api/Browser.js';
|
||||
import {BrowserContext} from '../api/BrowserContext.js';
|
||||
import {Page} from '../api/Page.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {ChromeTargetManager} from './ChromeTargetManager.js';
|
||||
import {CDPSession, Connection, ConnectionEmittedEvents} from './Connection.js';
|
||||
import {FirefoxTargetManager} from './FirefoxTargetManager.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {Target} from './Target.js';
|
||||
import {TargetManager, TargetManagerEmittedEvents} from './TargetManager.js';
|
||||
import {TaskQueue} from './TaskQueue.js';
|
||||
import {waitWithTimeout} from './util.js';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -14,18 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {debugError} from './util.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
import {IsPageTargetCallback, TargetFilterCallback} from '../api/Browser.js';
|
||||
import {isNode} from '../environment.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {IsPageTargetCallback, TargetFilterCallback} from '../api/Browser.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {CDPBrowser} from './Browser.js';
|
||||
import {Connection} from './Connection.js';
|
||||
import {ConnectionTransport} from './ConnectionTransport.js';
|
||||
import {getFetch} from './fetch.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
|
||||
import type {ConnectOptions} from './Puppeteer.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {debugError} from './util.js';
|
||||
/**
|
||||
* Generic browser options that can be passed when launching any browser or when
|
||||
* connecting to an existing browser instance.
|
||||
|
@ -15,18 +15,20 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {TargetFilterCallback} from '../api/Browser.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession, Connection} from './Connection.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Target} from './Target.js';
|
||||
import {debugError} from './util.js';
|
||||
import {TargetFilterCallback} from '../api/Browser.js';
|
||||
import {
|
||||
TargetInterceptor,
|
||||
TargetFactory,
|
||||
TargetManager,
|
||||
TargetManagerEmittedEvents,
|
||||
} from './TargetManager.js';
|
||||
import {debugError} from './util.js';
|
||||
|
||||
/**
|
||||
* ChromeTargetManager uses the CDP's auto-attach mechanism to intercept
|
||||
|
@ -13,16 +13,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/order */
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {debug} from './Debug.js';
|
||||
const debugProtocolSend = debug('puppeteer:protocol:SEND ►');
|
||||
const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀');
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
|
||||
|
||||
import {ConnectionTransport} from './ConnectionTransport.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {ProtocolError} from './Errors.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -14,12 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
import {addEventListener, debugError, PuppeteerEventListener} from './util.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {CDPSession} from './Connection.js';
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {EVALUATION_SCRIPT_URL} from './ExecutionContext.js';
|
||||
import {addEventListener, debugError, PuppeteerEventListener} from './util.js';
|
||||
import {removeEventListeners} from './util.js';
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
import type PuppeteerUtil from '../injected/injected.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {interpolateFunction, stringifyFunction} from '../util/Function.js';
|
||||
|
||||
import {QueryHandler, QuerySelector, QuerySelectorAll} from './QueryHandler.js';
|
||||
import {scriptInjector} from './ScriptInjector.js';
|
||||
|
||||
|
@ -14,10 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
|
||||
/**
|
||||
* Dialog instances are dispatched by the {@link Page} via the `dialog` event.
|
||||
*
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {
|
||||
BoundingBox,
|
||||
BoxModel,
|
||||
@ -27,13 +28,15 @@ import {
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {Page, ScreenshotOptions} from '../api/Page.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {FrameManager} from './FrameManager.js';
|
||||
import {getQueryHandlerAndSelector} from './GetQueryHandler.js';
|
||||
import {WaitForSelectorOptions} from './IsolatedWorld.js';
|
||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||
import {CDPJSHandle} from './JSHandle.js';
|
||||
import {CDPPage} from './Page.js';
|
||||
import {
|
||||
ElementFor,
|
||||
@ -44,7 +47,6 @@ import {
|
||||
} from './types.js';
|
||||
import {KeyInput} from './USKeyboardLayout.js';
|
||||
import {debugError, isString} from './util.js';
|
||||
import {CDPJSHandle} from './JSHandle.js';
|
||||
|
||||
const applyOffsetsToQuad = (
|
||||
quad: Point[],
|
||||
|
@ -13,9 +13,10 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -15,15 +15,19 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import type PuppeteerUtil from '../injected/injected.js';
|
||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||
import {stringifyFunction} from '../util/Function.js';
|
||||
|
||||
import {ARIAQueryHandler} from './AriaQueryHandler.js';
|
||||
import {Binding} from './Binding.js';
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {CDPElementHandle} from './ElementHandle.js';
|
||||
import {IsolatedWorld} from './IsolatedWorld.js';
|
||||
import {CDPJSHandle} from './JSHandle.js';
|
||||
import {LazyArg} from './LazyArg.js';
|
||||
import {scriptInjector} from './ScriptInjector.js';
|
||||
import {EvaluateFunc, HandleFor} from './types.js';
|
||||
@ -33,8 +37,6 @@ import {
|
||||
isString,
|
||||
valueFromRemoteObject,
|
||||
} from './util.js';
|
||||
import {CDPJSHandle} from './JSHandle.js';
|
||||
import {CDPElementHandle} from './ElementHandle.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -15,8 +15,9 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
/**
|
||||
* File choosers let you react to the page requesting for a file.
|
||||
|
@ -15,17 +15,19 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {CDPSession, Connection} from './Connection.js';
|
||||
import {Target} from './Target.js';
|
||||
|
||||
import {TargetFilterCallback} from '../api/Browser.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession, Connection} from './Connection.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Target} from './Target.js';
|
||||
import {
|
||||
TargetFactory,
|
||||
TargetInterceptor,
|
||||
TargetManagerEmittedEvents,
|
||||
TargetManager,
|
||||
} from './TargetManager.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
|
||||
/**
|
||||
* FirefoxTargetManager implements target management using
|
||||
|
@ -15,9 +15,11 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {Page} from '../api/Page.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
import {FrameManager} from './FrameManager.js';
|
||||
|
@ -15,8 +15,11 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {Page} from '../api/Page.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {CDPSession, isTargetClosedError} from './Connection.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {EVALUATION_SCRIPT_URL, ExecutionContext} from './ExecutionContext.js';
|
||||
@ -25,7 +28,6 @@ import {FrameTree} from './FrameTree.js';
|
||||
import {IsolatedWorld} from './IsolatedWorld.js';
|
||||
import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js';
|
||||
import {NetworkManager} from './NetworkManager.js';
|
||||
import {Page} from '../api/Page.js';
|
||||
import {Target} from './Target.js';
|
||||
import {TimeoutSettings} from './TimeoutSettings.js';
|
||||
import {debugError} from './util.js';
|
||||
|
@ -18,6 +18,7 @@ import {
|
||||
createDeferredPromise,
|
||||
DeferredPromise,
|
||||
} from '../util/DeferredPromise.js';
|
||||
|
||||
import type {Frame} from './Frame.js';
|
||||
|
||||
/**
|
||||
|
@ -15,12 +15,14 @@
|
||||
*/
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {ProtocolError} from './Errors.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {debugError, isString} from './util.js';
|
||||
import {HTTPResponse} from './HTTPResponse.js';
|
||||
import {debugError, isString} from './util.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -13,14 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
|
||||
|
||||
import {ProtocolError} from './Errors.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {HTTPRequest} from './HTTPRequest.js';
|
||||
import {SecurityDetails} from './SecurityDetails.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {ProtocolError} from './Errors.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
|
||||
import {AwaitableIterable, HandleFor} from './types.js';
|
||||
|
||||
const DEFAULT_BATCH_SIZE = 20;
|
||||
|
@ -14,11 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {Point} from '../api/ElementHandle.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {_keyDefinitions, KeyDefinition, KeyInput} from './USKeyboardLayout.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {Point} from '../api/ElementHandle.js';
|
||||
|
||||
type KeyDescription = Required<
|
||||
Pick<KeyDefinition, 'keyCode' | 'key' | 'text' | 'code' | 'location'>
|
||||
|
@ -15,9 +15,13 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {createDeferredPromise} from '../util/DeferredPromise.js';
|
||||
|
||||
import {Binding} from './Binding.js';
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
import {Frame} from './Frame.js';
|
||||
@ -37,9 +41,6 @@ import {
|
||||
import {addPageBinding, createJSHandle, debugError} from './util.js';
|
||||
import {TaskManager, WaitTask} from './WaitTask.js';
|
||||
|
||||
import type {ElementHandle} from '../api/ElementHandle.js';
|
||||
import {Binding} from './Binding.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
@ -15,8 +15,10 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import type {CDPElementHandle} from './ElementHandle.js';
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
|
@ -15,22 +15,23 @@
|
||||
*/
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
import {
|
||||
DeferredPromise,
|
||||
createDeferredPromise,
|
||||
} from '../util/DeferredPromise.js';
|
||||
|
||||
import {CDPSessionEmittedEvents} from './Connection.js';
|
||||
import {TimeoutError} from './Errors.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js';
|
||||
import {HTTPRequest} from './HTTPRequest.js';
|
||||
import {HTTPResponse} from './HTTPResponse.js';
|
||||
import {NetworkManagerEmittedEvents} from './NetworkManager.js';
|
||||
import {
|
||||
addEventListener,
|
||||
PuppeteerEventListener,
|
||||
removeEventListeners,
|
||||
} from './util.js';
|
||||
import {
|
||||
DeferredPromise,
|
||||
createDeferredPromise,
|
||||
} from '../util/DeferredPromise.js';
|
||||
import {TimeoutError} from './Errors.js';
|
||||
import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {HTTPRequest} from './HTTPRequest.js';
|
||||
import {HTTPResponse} from './HTTPResponse.js';
|
||||
import {NetworkManagerEmittedEvents} from './NetworkManager.js';
|
||||
import {CDPSessionEmittedEvents} from './Connection.js';
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {HTTPRequest} from './HTTPRequest.js';
|
||||
|
||||
/**
|
||||
|
@ -15,16 +15,18 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {assert} from '../util/assert.js';
|
||||
import {createDebuggableDeferredPromise} from '../util/DebuggableDeferredPromise.js';
|
||||
import {DeferredPromise} from '../util/DeferredPromise.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Frame} from './Frame.js';
|
||||
import {HTTPRequest} from './HTTPRequest.js';
|
||||
import {HTTPResponse} from './HTTPResponse.js';
|
||||
import {FetchRequestId, NetworkEventManager} from './NetworkEventManager.js';
|
||||
import {debugError, isString} from './util.js';
|
||||
import {DeferredPromise} from '../util/DeferredPromise.js';
|
||||
import {createDebuggableDeferredPromise} from '../util/DebuggableDeferredPromise.js';
|
||||
import {CDPSession} from './Connection.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import NodeWebSocket from 'ws';
|
||||
|
||||
import {ConnectionTransport} from '../common/ConnectionTransport.js';
|
||||
import {packageVersion} from '../generated/version.js';
|
||||
|
||||
|
@ -14,8 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import type {Readable} from 'stream';
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {Browser} from '../api/Browser.js';
|
||||
import type {BrowserContext} from '../api/BrowserContext.js';
|
||||
import {ElementHandle} from '../api/ElementHandle.js';
|
||||
@ -37,6 +39,7 @@ import {
|
||||
DeferredPromise,
|
||||
} from '../util/DeferredPromise.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {Accessibility} from './Accessibility.js';
|
||||
import {Binding} from './Binding.js';
|
||||
import {
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import type PuppeteerUtil from '../injected/injected.js';
|
||||
|
||||
import {QueryHandler} from './QueryHandler.js';
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {Browser} from '../api/Browser.js';
|
||||
|
||||
import {
|
||||
BrowserConnectOptions,
|
||||
_connectToCDPBrowser,
|
||||
|
@ -19,6 +19,7 @@ import type PuppeteerUtil from '../injected/injected.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
import {interpolateFunction, stringifyFunction} from '../util/Function.js';
|
||||
|
||||
import type {Frame} from './Frame.js';
|
||||
import {transposeIterableHandle} from './HandleIterator.js';
|
||||
import type {WaitForSelectorOptions} from './IsolatedWorld.js';
|
||||
|
@ -14,16 +14,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {Page, PageEmittedEvents} from '../api/Page.js';
|
||||
import {WebWorker} from './WebWorker.js';
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {Browser, IsPageTargetCallback} from '../api/Browser.js';
|
||||
import type {BrowserContext} from '../api/BrowserContext.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
import {TaskQueue} from './TaskQueue.js';
|
||||
import {TargetManager} from './TargetManager.js';
|
||||
import {Page, PageEmittedEvents} from '../api/Page.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {CDPPage} from './Page.js';
|
||||
import {Viewport} from './PuppeteerViewport.js';
|
||||
import {TargetManager} from './TargetManager.js';
|
||||
import {TaskQueue} from './TaskQueue.js';
|
||||
import {WebWorker} from './WebWorker.js';
|
||||
|
||||
/**
|
||||
* Target represents a
|
||||
|
@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {Target} from './Target.js';
|
||||
|
@ -14,9 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {assert} from '../util/assert.js';
|
||||
import {getReadableAsBuffer, getReadableFromProtocolStream} from './util.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {getReadableAsBuffer, getReadableFromProtocolStream} from './util.js';
|
||||
|
||||
/**
|
||||
* @public
|
||||
|
@ -19,6 +19,7 @@ import {JSHandle} from '../api/JSHandle.js';
|
||||
import type {Poller} from '../injected/Poller.js';
|
||||
import {createDeferredPromise} from '../util/DeferredPromise.js';
|
||||
import {stringifyFunction} from '../util/Function.js';
|
||||
|
||||
import {TimeoutError} from './Errors.js';
|
||||
import {IsolatedWorld} from './IsolatedWorld.js';
|
||||
import {LazyArg} from './LazyArg.js';
|
||||
|
@ -14,15 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import {Protocol} from 'devtools-protocol';
|
||||
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {createDeferredPromise} from '../util/DeferredPromise.js';
|
||||
|
||||
import {CDPSession} from './Connection.js';
|
||||
import {ConsoleMessageType} from './ConsoleMessage.js';
|
||||
import {EvaluateFunc, HandleFor} from './types.js';
|
||||
import {EventEmitter} from './EventEmitter.js';
|
||||
import {ExecutionContext} from './ExecutionContext.js';
|
||||
import {JSHandle} from '../api/JSHandle.js';
|
||||
import {CDPJSHandle} from './JSHandle.js';
|
||||
import {EvaluateFunc, HandleFor} from './types.js';
|
||||
import {debugError} from './util.js';
|
||||
import {createDeferredPromise} from '../util/DeferredPromise.js';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -1,10 +1,12 @@
|
||||
import {CDPSession, Connection as CDPPPtrConnection} from '../Connection.js';
|
||||
import {Connection as BidiPPtrConnection} from './Connection.js';
|
||||
import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js';
|
||||
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||
import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
|
||||
|
||||
import {CDPSession, Connection as CDPPPtrConnection} from '../Connection.js';
|
||||
import {Handler} from '../EventEmitter.js';
|
||||
|
||||
import {Connection as BidiPPtrConnection} from './Connection.js';
|
||||
|
||||
type CdpEvents = {
|
||||
[Property in keyof ProtocolMapping.Events]: ProtocolMapping.Events[Property][0];
|
||||
};
|
||||
|
@ -14,15 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {ChildProcess} from 'child_process';
|
||||
|
||||
import {
|
||||
Browser as BrowserBase,
|
||||
BrowserCloseCallback,
|
||||
BrowserContextOptions,
|
||||
} from '../../api/Browser.js';
|
||||
import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js';
|
||||
import {Connection} from './Connection.js';
|
||||
import {ChildProcess} from 'child_process';
|
||||
|
||||
import {BrowserContext} from './BrowserContext.js';
|
||||
import {Connection} from './Connection.js';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js';
|
||||
import {Page as PageBase} from '../../api/Page.js';
|
||||
|
||||
import {Connection} from './Connection.js';
|
||||
import {Page} from './Page.js';
|
||||
|
||||
|
@ -14,14 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable import/order */
|
||||
import {debug} from '../Debug.js';
|
||||
const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►');
|
||||
const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀');
|
||||
|
||||
import {ConnectionTransport} from '../ConnectionTransport.js';
|
||||
import {EventEmitter} from '../EventEmitter.js';
|
||||
import {ProtocolError} from '../Errors.js';
|
||||
import {EventEmitter} from '../EventEmitter.js';
|
||||
import {ConnectionCallback} from '../Connection.js';
|
||||
|
||||
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||
|
||||
/**
|
||||
|
@ -14,15 +14,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {ElementHandle} from '../../api/ElementHandle.js';
|
||||
import {EvaluateFuncWith, HandleFor, HandleOr} from '../../common/types.js';
|
||||
import {releaseReference} from './utils.js';
|
||||
import {Page} from './Page.js';
|
||||
import {JSHandle as BaseJSHandle} from '../../api/JSHandle.js';
|
||||
import {BidiSerializer} from './Serializer.js';
|
||||
import {Connection} from './Connection.js';
|
||||
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||
|
||||
import {ElementHandle} from '../../api/ElementHandle.js';
|
||||
import {JSHandle as BaseJSHandle} from '../../api/JSHandle.js';
|
||||
import {EvaluateFuncWith, HandleFor, HandleOr} from '../../common/types.js';
|
||||
|
||||
import {Connection} from './Connection.js';
|
||||
import {Page} from './Page.js';
|
||||
import {BidiSerializer} from './Serializer.js';
|
||||
import {releaseReference} from './utils.js';
|
||||
|
||||
export class JSHandle<T = unknown> extends BaseJSHandle<T> {
|
||||
#disposed = false;
|
||||
#context;
|
||||
|
@ -15,13 +15,14 @@
|
||||
*/
|
||||
|
||||
import {Page as PageBase} from '../../api/Page.js';
|
||||
import {Connection} from './Connection.js';
|
||||
import {stringifyFunction} from '../../util/Function.js';
|
||||
import type {EvaluateFunc, HandleFor} from '../types.js';
|
||||
import {isString} from '../util.js';
|
||||
import {BidiSerializer} from './Serializer.js';
|
||||
|
||||
import {Connection} from './Connection.js';
|
||||
import {JSHandle} from './JSHandle.js';
|
||||
import {BidiSerializer} from './Serializer.js';
|
||||
import {Reference} from './types.js';
|
||||
import {stringifyFunction} from '../../util/Function.js';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
@ -1,5 +1,7 @@
|
||||
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||
|
||||
import {debugError, isDate, isPlainObject, isRegExp} from '../util.js';
|
||||
|
||||
import {JSHandle} from './JSHandle.js';
|
||||
import {Page} from './Page.js';
|
||||
|
||||
|
@ -14,8 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {debug} from '../Debug.js';
|
||||
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
|
||||
|
||||
import {debug} from '../Debug.js';
|
||||
|
||||
import {Connection} from './Connection.js';
|
||||
|
||||
/**
|
||||
|
@ -14,8 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type {JSHandle} from '../api/JSHandle.js';
|
||||
import type {ElementHandle} from '../api/ElementHandle.js';
|
||||
import type {JSHandle} from '../api/JSHandle.js';
|
||||
|
||||
import type {LazyArg} from './LazyArg.js';
|
||||
|
||||
/**
|
||||
|
@ -14,13 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import type {Protocol} from 'devtools-protocol';
|
||||
import type {Readable} from 'stream';
|
||||
|
||||
import type {Protocol} from 'devtools-protocol';
|
||||
|
||||
import type {ElementHandle} from '../api/ElementHandle.js';
|
||||
import type {JSHandle} from '../api/JSHandle.js';
|
||||
import {isNode} from '../environment.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import type {CDPSession} from './Connection.js';
|
||||
import {debug} from './Debug.js';
|
||||
import {CDPElementHandle} from './ElementHandle.js';
|
||||
|
@ -1,6 +1,7 @@
|
||||
import type {AwaitableIterable} from '../common/types.js';
|
||||
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
|
||||
import {isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {ariaQuerySelectorAll} from './ARIAQuerySelector.js';
|
||||
import {customQuerySelectors} from './CustomQuerySelector.js';
|
||||
import {parsePSelectors, PSelector} from './PSelectorParser.js';
|
||||
|
@ -16,16 +16,17 @@
|
||||
|
||||
import {createDeferredPromise} from '../util/DeferredPromise.js';
|
||||
import {createFunction} from '../util/Function.js';
|
||||
|
||||
import * as ARIAQuerySelector from './ARIAQuerySelector.js';
|
||||
import * as CustomQuerySelectors from './CustomQuerySelector.js';
|
||||
import * as PierceQuerySelector from './PierceQuerySelector.js';
|
||||
import {IntervalPoller, MutationPoller, RAFPoller} from './Poller.js';
|
||||
import * as PQuerySelector from './PQuerySelector.js';
|
||||
import {
|
||||
createTextContent,
|
||||
isSuitableNodeForTextMatching,
|
||||
} from './TextContent.js';
|
||||
import * as TextQuerySelector from './TextQuerySelector.js';
|
||||
import * as PQuerySelector from './PQuerySelector.js';
|
||||
import * as util from './util.js';
|
||||
import * as XPathQuerySelector from './XPathQuerySelector.js';
|
||||
|
||||
|
@ -15,24 +15,26 @@
|
||||
*/
|
||||
|
||||
import {exec as execChildProcess} from 'child_process';
|
||||
import extractZip from 'extract-zip';
|
||||
import {createReadStream, createWriteStream, existsSync, readdirSync} from 'fs';
|
||||
import {chmod, mkdir, readdir, unlink} from 'fs/promises';
|
||||
import * as http from 'http';
|
||||
import * as https from 'https';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as URL from 'url';
|
||||
import * as util from 'util';
|
||||
import {promisify} from 'util';
|
||||
|
||||
import extractZip from 'extract-zip';
|
||||
import createHttpsProxyAgent, {
|
||||
HttpsProxyAgent,
|
||||
HttpsProxyAgentOptions,
|
||||
} from 'https-proxy-agent';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {getProxyForUrl} from 'proxy-from-env';
|
||||
import removeRecursive from 'rimraf';
|
||||
import tar from 'tar-fs';
|
||||
import bzip from 'unbzip2-stream';
|
||||
import * as URL from 'url';
|
||||
import * as util from 'util';
|
||||
import {promisify} from 'util';
|
||||
|
||||
import {debug} from '../common/Debug.js';
|
||||
import {Product} from '../common/Product.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
@ -18,8 +18,10 @@ import * as childProcess from 'child_process';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as readline from 'readline';
|
||||
import removeFolder from 'rimraf';
|
||||
import {promisify} from 'util';
|
||||
|
||||
import removeFolder from 'rimraf';
|
||||
|
||||
import type {Connection as BiDiConnection} from '../common/bidi/bidi.js';
|
||||
import {Connection} from '../common/Connection.js';
|
||||
import {debug} from '../common/Debug.js';
|
||||
@ -34,6 +36,7 @@ import {
|
||||
} from '../common/util.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {isErrnoException, isErrorLike} from '../util/ErrorLike.js';
|
||||
|
||||
import {LaunchOptions} from './LaunchOptions.js';
|
||||
import {PipeTransport} from './PipeTransport.js';
|
||||
|
||||
|
@ -2,10 +2,12 @@ import {accessSync} from 'fs';
|
||||
import {mkdtemp} from 'fs/promises';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {Browser} from '../api/Browser.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
import {BrowserRunner} from './BrowserRunner.js';
|
||||
import {CDPBrowser} from '../common/Browser.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {BrowserRunner} from './BrowserRunner.js';
|
||||
import {
|
||||
BrowserLaunchArgumentOptions,
|
||||
ChromeReleaseChannel,
|
||||
|
@ -1,9 +1,11 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import {Browser} from '../api/Browser.js';
|
||||
import {CDPBrowser} from '../common/Browser.js';
|
||||
import {assert} from '../util/assert.js';
|
||||
|
||||
import {BrowserRunner} from './BrowserRunner.js';
|
||||
import {
|
||||
BrowserLaunchArgumentOptions,
|
||||
|
@ -16,8 +16,10 @@
|
||||
import {existsSync} from 'fs';
|
||||
import os, {tmpdir} from 'os';
|
||||
import {join} from 'path';
|
||||
|
||||
import {Browser} from '../api/Browser.js';
|
||||
import {Product} from '../common/Product.js';
|
||||
|
||||
import {
|
||||
BrowserLaunchArgumentOptions,
|
||||
ChromeReleaseChannel,
|
||||
|
@ -15,16 +15,18 @@
|
||||
*/
|
||||
|
||||
import {join} from 'path';
|
||||
|
||||
import {Browser} from '../api/Browser.js';
|
||||
import {BrowserConnectOptions} from '../common/BrowserConnector.js';
|
||||
import {Configuration} from '../common/Configuration.js';
|
||||
import {Product} from '../common/Product.js';
|
||||
import {
|
||||
CommonPuppeteerSettings,
|
||||
ConnectOptions,
|
||||
Puppeteer,
|
||||
} from '../common/Puppeteer.js';
|
||||
import {Configuration} from '../common/Configuration.js';
|
||||
import {PUPPETEER_REVISIONS} from '../revisions.js';
|
||||
|
||||
import {BrowserFetcher, BrowserFetcherOptions} from './BrowserFetcher.js';
|
||||
import {ChromeLauncher} from './ChromeLauncher.js';
|
||||
import {FirefoxLauncher} from './FirefoxLauncher.js';
|
||||
|
@ -1,4 +1,5 @@
|
||||
import {DEFERRED_PROMISE_DEBUG_TIMEOUT} from '../environment.js';
|
||||
|
||||
import {DeferredPromise, createDeferredPromise} from './DeferredPromise.js';
|
||||
|
||||
/**
|
||||
|
@ -34,10 +34,10 @@
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line import/extensions
|
||||
import {PUPPETEER_REVISIONS} from '../src/revisions.js';
|
||||
import {execSync} from 'child_process';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import {PUPPETEER_REVISIONS} from '../src/revisions.js';
|
||||
|
||||
const currentProtocolPackageInstalledVersion =
|
||||
packageJson.dependencies['devtools-protocol'];
|
||||
|
@ -1,8 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
import esbuild from 'esbuild';
|
||||
import {mkdir, mkdtemp, readFile, rm, writeFile} from 'fs/promises';
|
||||
import path, {join, resolve} from 'path';
|
||||
import {chdir} from 'process';
|
||||
|
||||
import esbuild from 'esbuild';
|
||||
|
||||
import {job} from '../../../tools/internal/job.js';
|
||||
|
||||
const packageRoot = resolve(join(__dirname, '..'));
|
||||
|
@ -24,9 +24,9 @@
|
||||
* necessary.
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const {execSync} = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Need to ensure TS is compiled before loading the installer
|
||||
if (!fs.existsSync(path.join(__dirname, 'lib'))) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import {cosmiconfigSync} from 'cosmiconfig';
|
||||
import {homedir} from 'os';
|
||||
import {join} from 'path';
|
||||
|
||||
import {cosmiconfigSync} from 'cosmiconfig';
|
||||
import {Configuration, Product} from 'puppeteer-core';
|
||||
|
||||
/**
|
||||
|
@ -15,12 +15,14 @@
|
||||
*/
|
||||
|
||||
import https, {RequestOptions} from 'https';
|
||||
import URL from 'url';
|
||||
|
||||
import createHttpsProxyAgent, {HttpsProxyAgentOptions} from 'https-proxy-agent';
|
||||
import ProgressBar from 'progress';
|
||||
import {getProxyForUrl} from 'proxy-from-env';
|
||||
import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js';
|
||||
import URL from 'url';
|
||||
|
||||
import {getConfiguration} from '../getConfiguration.js';
|
||||
|
||||
/**
|
||||
|
@ -19,6 +19,7 @@ export {Protocol} from 'puppeteer-core';
|
||||
export * from 'puppeteer-core/internal/puppeteer-core.js';
|
||||
|
||||
import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js';
|
||||
|
||||
import {getConfiguration} from './getConfiguration.js';
|
||||
|
||||
const configuration = getConfiguration();
|
||||
|
@ -28,13 +28,14 @@ import {
|
||||
Server as HttpsServer,
|
||||
ServerOptions as HttpsServerOptions,
|
||||
} from 'https';
|
||||
import {getType as getMimeType} from 'mime';
|
||||
import {AddressInfo} from 'net';
|
||||
import {join} from 'path';
|
||||
import {Duplex} from 'stream';
|
||||
import {Server as WebSocketServer, WebSocket} from 'ws';
|
||||
import {gzip} from 'zlib';
|
||||
|
||||
import {getType as getMimeType} from 'mime';
|
||||
import {Server as WebSocketServer, WebSocket} from 'ws';
|
||||
|
||||
interface Subscriber {
|
||||
resolve: (msg: IncomingMessage) => void;
|
||||
reject: (err?: Error) => void;
|
||||
|
@ -14,10 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import glob from 'glob';
|
||||
import {dirname, join, resolve} from 'path';
|
||||
import {fileURLToPath} from 'url';
|
||||
|
||||
import glob from 'glob';
|
||||
|
||||
export const PUPPETEER_CORE_PACKAGE_PATH = resolve(
|
||||
glob.sync('puppeteer-core-*.tgz')[0]!
|
||||
);
|
||||
|
@ -18,6 +18,7 @@ import {createHash} from 'crypto';
|
||||
import {mkdtemp, rm, writeFile} from 'fs/promises';
|
||||
import {tmpdir} from 'os';
|
||||
import {join} from 'path';
|
||||
|
||||
import {
|
||||
PUPPETEER_CORE_PACKAGE_PATH,
|
||||
PUPPETEER_PACKAGE_PATH,
|
||||
|
@ -17,6 +17,7 @@
|
||||
import assert from 'assert';
|
||||
import {readdir, writeFile} from 'fs/promises';
|
||||
import {join} from 'path';
|
||||
|
||||
import {describeInstallation} from './describeInstallation.js';
|
||||
import {readAsset} from './util.js';
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
import assert from 'assert';
|
||||
import {readdir} from 'fs/promises';
|
||||
import {join} from 'path';
|
||||
|
||||
import {describeInstallation} from './describeInstallation.js';
|
||||
import {readAsset} from './util.js';
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
import {readFile, rm, writeFile} from 'fs/promises';
|
||||
import {join} from 'path';
|
||||
|
||||
import {describeInstallation} from './describeInstallation.js';
|
||||
import {execFile, readAsset} from './util.js';
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
import assert from 'assert';
|
||||
import {readdir} from 'fs/promises';
|
||||
import {join} from 'path';
|
||||
|
||||
import {describeInstallation} from './describeInstallation.js';
|
||||
import {readAsset} from './util.js';
|
||||
|
||||
|
@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {promisify} from 'util';
|
||||
import {execFile as execFileAsync} from 'child_process';
|
||||
import {join} from 'path';
|
||||
import {ASSETS_DIR} from './constants.js';
|
||||
import {readFile} from 'fs/promises';
|
||||
import {join} from 'path';
|
||||
import {promisify} from 'util';
|
||||
|
||||
import {ASSETS_DIR} from './constants.js';
|
||||
|
||||
export const execFile = promisify(execFileAsync);
|
||||
export const readAsset = (...components: string[]): Promise<string> => {
|
||||
|
@ -14,14 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {waitEvent} from './utils.js';
|
||||
import expect from 'expect';
|
||||
import {isErrorLike} from 'puppeteer-core/internal/util/ErrorLike.js';
|
||||
|
||||
import {
|
||||
getTestState,
|
||||
setupTestBrowserHooks,
|
||||
setupTestPageAndContextHooks,
|
||||
} from './mocha-utils.js';
|
||||
import {isErrorLike} from 'puppeteer-core/internal/util/ErrorLike.js';
|
||||
import {waitEvent} from './utils.js';
|
||||
|
||||
describe('Target.createCDPSession', function () {
|
||||
setupTestBrowserHooks();
|
||||
|
@ -14,9 +14,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import expect from 'expect';
|
||||
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
|
||||
import sinon from 'sinon';
|
||||
import expect from 'expect';
|
||||
|
||||
describe('EventEmitter', () => {
|
||||
let emitter: EventEmitter;
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
|
||||
import expect from 'expect';
|
||||
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
|
||||
import {Frame} from 'puppeteer-core/internal/common/Frame.js';
|
||||
import {HTTPRequest} from 'puppeteer-core/internal/common/HTTPRequest.js';
|
||||
import {HTTPResponse} from 'puppeteer-core/internal/common/HTTPResponse.js';
|
||||
import {
|
||||
NetworkManager,
|
||||
NetworkManagerEmittedEvents,
|
||||
} from 'puppeteer-core/internal/common/NetworkManager.js';
|
||||
import {HTTPRequest} from 'puppeteer-core/internal/common/HTTPRequest.js';
|
||||
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
|
||||
import {Frame} from 'puppeteer-core/internal/common/Frame.js';
|
||||
import {HTTPResponse} from 'puppeteer-core/internal/common/HTTPResponse.js';
|
||||
|
||||
class MockCDPSession extends EventEmitter {
|
||||
async send(): Promise<any> {}
|
||||
|
@ -14,16 +14,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import {getTestState} from './mocha-utils'; // eslint-disable-line import/extensions
|
||||
import utils from './utils.js';
|
||||
|
||||
import expect from 'expect';
|
||||
|
||||
import {
|
||||
CDPBrowser,
|
||||
CDPBrowserContext,
|
||||
} from 'puppeteer-core/internal/common/Browser.js';
|
||||
|
||||
import {getTestState} from './mocha-utils'; // eslint-disable-line import/extensions
|
||||
import utils from './utils.js';
|
||||
|
||||
describe('TargetManager', () => {
|
||||
/* We use a special browser for this test as we need the --site-per-process flag */
|
||||
let browser: CDPBrowser;
|
||||
|
@ -15,8 +15,10 @@
|
||||
*/
|
||||
|
||||
import assert from 'assert';
|
||||
|
||||
import expect from 'expect';
|
||||
import {SerializedAXNode} from 'puppeteer-core/internal/common/Accessibility.js';
|
||||
|
||||
import {
|
||||
getTestState,
|
||||
setupTestBrowserHooks,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user