@remotion/renderer 4.0.0-fastlambda.8 → 4.0.0-lambda.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/cleanup-assets.d.ts +2 -0
- package/dist/assets/cleanup-assets.js +2 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +6 -0
- package/dist/assets/download-and-map-assets-to-file.js +46 -19
- package/dist/assets/ffmpeg-volume-expression.d.ts +2 -1
- package/dist/assets/ffmpeg-volume-expression.js +15 -12
- package/dist/assets/get-audio-channels.d.ts +5 -2
- package/dist/assets/get-audio-channels.js +15 -4
- package/dist/browser/Accessibility.d.ts +175 -0
- package/dist/browser/Accessibility.js +423 -0
- package/dist/browser/AriaQueryHandler.d.ts +20 -0
- package/dist/browser/AriaQueryHandler.js +108 -0
- package/dist/browser/Browser.d.ts +209 -0
- package/dist/browser/Browser.js +402 -0
- package/dist/browser/BrowserConnector.d.ts +26 -0
- package/dist/browser/BrowserConnector.js +49 -0
- package/dist/browser/BrowserFetcher.d.ts +89 -0
- package/dist/browser/BrowserFetcher.js +512 -0
- package/dist/browser/BrowserRunner.d.ts +39 -0
- package/dist/browser/BrowserRunner.js +308 -0
- package/dist/browser/Connection.d.ts +49 -0
- package/dist/browser/Connection.js +262 -0
- package/dist/browser/ConnectionTransport.d.ts +21 -0
- package/dist/browser/ConnectionTransport.js +17 -0
- package/dist/browser/ConsoleMessage.d.ts +55 -0
- package/dist/browser/ConsoleMessage.js +75 -0
- package/dist/browser/Coverage.d.ts +180 -0
- package/dist/browser/Coverage.js +371 -0
- package/dist/browser/DOMWorld.d.ts +50 -0
- package/dist/browser/DOMWorld.js +280 -0
- package/dist/browser/Debug.d.ts +19 -0
- package/dist/browser/Debug.js +42 -0
- package/dist/browser/DeviceDescriptors.d.ts +40 -0
- package/dist/browser/DeviceDescriptors.js +1407 -0
- package/dist/browser/EmulationManager.d.ts +7 -0
- package/dist/browser/EmulationManager.js +40 -0
- package/dist/browser/Errors.d.ts +25 -0
- package/dist/browser/Errors.js +35 -0
- package/dist/browser/EvalTypes.d.ts +27 -0
- package/dist/browser/EvalTypes.js +17 -0
- package/dist/browser/EventEmitter.d.ts +70 -0
- package/dist/browser/EventEmitter.js +102 -0
- package/dist/browser/ExecutionContext.d.ts +35 -0
- package/dist/browser/ExecutionContext.js +190 -0
- package/dist/browser/FileChooser.d.ts +56 -0
- package/dist/browser/FileChooser.js +86 -0
- package/dist/browser/FrameManager.d.ts +96 -0
- package/dist/browser/FrameManager.js +512 -0
- package/dist/browser/HTTPRequest.d.ts +42 -0
- package/dist/browser/HTTPRequest.js +82 -0
- package/dist/browser/HTTPResponse.d.ts +100 -0
- package/dist/browser/HTTPResponse.js +196 -0
- package/dist/browser/Input.d.ts +355 -0
- package/dist/browser/Input.js +592 -0
- package/dist/browser/JSHandle.d.ts +36 -0
- package/dist/browser/JSHandle.js +93 -0
- package/dist/browser/LaunchOptions.d.ts +117 -0
- package/dist/browser/LaunchOptions.js +17 -0
- package/dist/browser/Launcher.d.ts +9 -0
- package/dist/browser/Launcher.js +602 -0
- package/dist/browser/LifecycleWatcher.d.ts +29 -0
- package/dist/browser/LifecycleWatcher.js +193 -0
- package/dist/browser/NetworkConditions.d.ts +26 -0
- package/dist/browser/NetworkConditions.js +33 -0
- package/dist/browser/NetworkEventManager.d.ts +35 -0
- package/dist/browser/NetworkEventManager.js +128 -0
- package/dist/browser/NetworkManager.d.ts +36 -0
- package/dist/browser/NetworkManager.js +284 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +11 -0
- package/dist/browser/NodeWebSocketTransport.js +90 -0
- package/dist/browser/PDFOptions.d.ts +165 -0
- package/dist/browser/PDFOptions.js +34 -0
- package/dist/browser/PipeTransport.d.ts +10 -0
- package/dist/browser/PipeTransport.js +86 -0
- package/dist/browser/Product.d.ts +16 -0
- package/dist/browser/Product.js +17 -0
- package/dist/browser/Puppeteer.d.ts +35 -0
- package/dist/browser/Puppeteer.js +17 -0
- package/dist/browser/PuppeteerNode.d.ts +92 -0
- package/dist/browser/PuppeteerNode.js +143 -0
- package/dist/browser/PuppeteerViewport.d.ts +5 -0
- package/dist/browser/PuppeteerViewport.js +2 -0
- package/dist/browser/QueryHandler.d.ts +64 -0
- package/dist/browser/QueryHandler.js +183 -0
- package/dist/browser/ScreenshotOptions.d.ts +14 -0
- package/dist/browser/ScreenshotOptions.js +2 -0
- package/dist/browser/SecurityDetails.d.ts +55 -0
- package/dist/browser/SecurityDetails.js +95 -0
- package/dist/browser/Target.d.ts +61 -0
- package/dist/browser/Target.js +146 -0
- package/dist/browser/TaskQueue.d.ts +20 -0
- package/dist/browser/TaskQueue.js +47 -0
- package/dist/browser/TimeoutSettings.d.ts +23 -0
- package/dist/browser/TimeoutSettings.js +62 -0
- package/dist/browser/Tracing.d.ts +45 -0
- package/dist/browser/Tracing.js +136 -0
- package/dist/browser/USKeyboardLayout.d.ts +39 -0
- package/dist/browser/USKeyboardLayout.js +406 -0
- package/dist/browser/WebWorker.d.ts +96 -0
- package/dist/browser/WebWorker.js +122 -0
- package/dist/browser/assert.d.ts +21 -0
- package/dist/browser/assert.js +29 -0
- package/dist/browser/compat.d.ts +2 -0
- package/dist/browser/compat.js +17 -0
- package/dist/browser/create-browser-fetcher.d.ts +17 -0
- package/dist/browser/create-browser-fetcher.js +140 -0
- package/dist/browser/dialog.d.ts +70 -0
- package/dist/browser/dialog.js +114 -0
- package/dist/browser/environment.d.ts +16 -0
- package/dist/browser/environment.js +19 -0
- package/dist/browser/fetch.d.ts +16 -0
- package/dist/browser/fetch.js +46 -0
- package/dist/browser/find-up.d.ts +4 -0
- package/dist/browser/find-up.js +85 -0
- package/dist/browser/get-download-destination.d.ts +1 -0
- package/dist/browser/get-download-destination.js +38 -0
- package/dist/browser/mitt/index.d.ts +22 -0
- package/dist/browser/mitt/index.js +49 -0
- package/dist/browser/node.d.ts +2 -0
- package/dist/browser/node.js +9 -0
- package/dist/browser/page.d.ts +78 -0
- package/dist/browser/page.js +277 -0
- package/dist/browser/pkg-dir.d.ts +3 -0
- package/dist/browser/pkg-dir.js +13 -0
- package/dist/browser/revisions.d.ts +21 -0
- package/dist/browser/revisions.js +22 -0
- package/dist/browser/util.d.ts +46 -0
- package/dist/browser/util.js +161 -0
- package/dist/calculate-ffmpeg-filters.js +2 -2
- package/dist/combine-videos.d.ts +2 -1
- package/dist/combine-videos.js +8 -1
- package/dist/cycle-browser-tabs.d.ts +2 -1
- package/dist/cycle-browser-tabs.js +9 -2
- package/dist/ensure-presentation-timestamp.d.ts +1 -0
- package/dist/ensure-presentation-timestamp.js +57 -0
- package/dist/extract-frame-from-video.d.ts +11 -0
- package/dist/extract-frame-from-video.js +197 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +1 -0
- package/dist/frame-to-ffmpeg-timestamp.js +8 -0
- package/dist/get-compositions.d.ts +5 -2
- package/dist/get-compositions.js +23 -5
- package/dist/get-duration-of-asset.d.ts +7 -0
- package/dist/get-duration-of-asset.js +36 -0
- package/dist/get-port.js +26 -24
- package/dist/index.d.ts +33 -9
- package/dist/index.js +14 -5
- package/dist/is-beyond-last-frame.d.ts +2 -0
- package/dist/is-beyond-last-frame.js +12 -0
- package/dist/last-frame-from-video-cache.d.ts +10 -0
- package/dist/last-frame-from-video-cache.js +50 -0
- package/dist/make-assets-download-dir.js +6 -1
- package/dist/make-cancel-signal.d.ts +7 -0
- package/dist/make-cancel-signal.js +25 -0
- package/dist/merge-audio-track.js +2 -2
- package/dist/offthread-video-server.d.ts +14 -0
- package/dist/offthread-video-server.js +67 -0
- package/dist/open-browser.d.ts +6 -6
- package/dist/open-browser.js +24 -20
- package/dist/prepare-server.d.ts +13 -2
- package/dist/prepare-server.js +35 -5
- package/dist/preprocess-audio-track.d.ts +1 -0
- package/dist/preprocess-audio-track.js +2 -2
- package/dist/prespawn-ffmpeg.d.ts +2 -0
- package/dist/prespawn-ffmpeg.js +10 -9
- package/dist/provide-screenshot.js +1 -1
- package/dist/puppeteer-screenshot.js +5 -1
- package/dist/render-frames.d.ts +6 -1
- package/dist/render-frames.js +96 -37
- package/dist/render-media.d.ts +12 -2
- package/dist/render-media.js +127 -54
- package/dist/render-still.d.ts +14 -4
- package/dist/render-still.js +58 -19
- package/dist/serve-handler/glob-slash.d.ts +1 -0
- package/dist/serve-handler/glob-slash.js +12 -0
- package/dist/serve-handler/index.d.ts +4 -0
- package/dist/serve-handler/index.js +205 -0
- package/dist/serve-handler/is-path-inside.d.ts +1 -0
- package/dist/serve-handler/is-path-inside.js +27 -0
- package/dist/serve-handler/range-parser.d.ts +13 -0
- package/dist/serve-handler/range-parser.js +57 -0
- package/dist/serve-static.d.ts +10 -3
- package/dist/serve-static.js +22 -4
- package/dist/set-props-and-env.d.ts +3 -1
- package/dist/set-props-and-env.js +28 -6
- package/dist/stitch-frames-to-video.d.ts +4 -1
- package/dist/stitch-frames-to-video.js +36 -15
- package/dist/stringify-ffmpeg-filter.js +3 -0
- package/dist/tmp-dir.js +5 -1
- package/dist/validate-fps-for-gif.d.ts +2 -0
- package/dist/validate-fps-for-gif.js +9 -0
- package/package.json +6 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface ScreenshotClip {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ScreenshotOptions {
|
|
8
|
+
type: 'png' | 'jpeg';
|
|
9
|
+
path?: string;
|
|
10
|
+
clip?: ScreenshotClip;
|
|
11
|
+
quality?: number;
|
|
12
|
+
omitBackground: boolean;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Protocol } from 'devtools-protocol';
|
|
17
|
+
/**
|
|
18
|
+
* The SecurityDetails class represents the security details of a
|
|
19
|
+
* response that was received over a secure connection.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare class SecurityDetails {
|
|
24
|
+
#private;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
constructor(securityPayload: Protocol.Network.SecurityDetails);
|
|
29
|
+
/**
|
|
30
|
+
* @returns The name of the issuer of the certificate.
|
|
31
|
+
*/
|
|
32
|
+
issuer(): string;
|
|
33
|
+
/**
|
|
34
|
+
* @returns {@link https://en.wikipedia.org/wiki/Unix_time | Unix timestamp}
|
|
35
|
+
* marking the start of the certificate's validity.
|
|
36
|
+
*/
|
|
37
|
+
validFrom(): number;
|
|
38
|
+
/**
|
|
39
|
+
* @returns {@link https://en.wikipedia.org/wiki/Unix_time | Unix timestamp}
|
|
40
|
+
* marking the end of the certificate's validity.
|
|
41
|
+
*/
|
|
42
|
+
validTo(): number;
|
|
43
|
+
/**
|
|
44
|
+
* @returns The security protocol being used, e.g. "TLS 1.2".
|
|
45
|
+
*/
|
|
46
|
+
protocol(): string;
|
|
47
|
+
/**
|
|
48
|
+
* @returns The name of the subject to which the certificate was issued.
|
|
49
|
+
*/
|
|
50
|
+
subjectName(): string;
|
|
51
|
+
/**
|
|
52
|
+
* @returns The list of {@link https://en.wikipedia.org/wiki/Subject_Alternative_Name | subject alternative names (SANs)} of the certificate.
|
|
53
|
+
*/
|
|
54
|
+
subjectAlternativeNames(): string[];
|
|
55
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _SecurityDetails_subjectName, _SecurityDetails_issuer, _SecurityDetails_validFrom, _SecurityDetails_validTo, _SecurityDetails_protocol, _SecurityDetails_sanList;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.SecurityDetails = void 0;
|
|
31
|
+
/**
|
|
32
|
+
* The SecurityDetails class represents the security details of a
|
|
33
|
+
* response that was received over a secure connection.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
class SecurityDetails {
|
|
38
|
+
/**
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
41
|
+
constructor(securityPayload) {
|
|
42
|
+
_SecurityDetails_subjectName.set(this, void 0);
|
|
43
|
+
_SecurityDetails_issuer.set(this, void 0);
|
|
44
|
+
_SecurityDetails_validFrom.set(this, void 0);
|
|
45
|
+
_SecurityDetails_validTo.set(this, void 0);
|
|
46
|
+
_SecurityDetails_protocol.set(this, void 0);
|
|
47
|
+
_SecurityDetails_sanList.set(this, void 0);
|
|
48
|
+
__classPrivateFieldSet(this, _SecurityDetails_subjectName, securityPayload.subjectName, "f");
|
|
49
|
+
__classPrivateFieldSet(this, _SecurityDetails_issuer, securityPayload.issuer, "f");
|
|
50
|
+
__classPrivateFieldSet(this, _SecurityDetails_validFrom, securityPayload.validFrom, "f");
|
|
51
|
+
__classPrivateFieldSet(this, _SecurityDetails_validTo, securityPayload.validTo, "f");
|
|
52
|
+
__classPrivateFieldSet(this, _SecurityDetails_protocol, securityPayload.protocol, "f");
|
|
53
|
+
__classPrivateFieldSet(this, _SecurityDetails_sanList, securityPayload.sanList, "f");
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @returns The name of the issuer of the certificate.
|
|
57
|
+
*/
|
|
58
|
+
issuer() {
|
|
59
|
+
return __classPrivateFieldGet(this, _SecurityDetails_issuer, "f");
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @returns {@link https://en.wikipedia.org/wiki/Unix_time | Unix timestamp}
|
|
63
|
+
* marking the start of the certificate's validity.
|
|
64
|
+
*/
|
|
65
|
+
validFrom() {
|
|
66
|
+
return __classPrivateFieldGet(this, _SecurityDetails_validFrom, "f");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @returns {@link https://en.wikipedia.org/wiki/Unix_time | Unix timestamp}
|
|
70
|
+
* marking the end of the certificate's validity.
|
|
71
|
+
*/
|
|
72
|
+
validTo() {
|
|
73
|
+
return __classPrivateFieldGet(this, _SecurityDetails_validTo, "f");
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* @returns The security protocol being used, e.g. "TLS 1.2".
|
|
77
|
+
*/
|
|
78
|
+
protocol() {
|
|
79
|
+
return __classPrivateFieldGet(this, _SecurityDetails_protocol, "f");
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @returns The name of the subject to which the certificate was issued.
|
|
83
|
+
*/
|
|
84
|
+
subjectName() {
|
|
85
|
+
return __classPrivateFieldGet(this, _SecurityDetails_subjectName, "f");
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* @returns The list of {@link https://en.wikipedia.org/wiki/Subject_Alternative_Name | subject alternative names (SANs)} of the certificate.
|
|
89
|
+
*/
|
|
90
|
+
subjectAlternativeNames() {
|
|
91
|
+
return __classPrivateFieldGet(this, _SecurityDetails_sanList, "f");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.SecurityDetails = SecurityDetails;
|
|
95
|
+
_SecurityDetails_subjectName = new WeakMap(), _SecurityDetails_issuer = new WeakMap(), _SecurityDetails_validFrom = new WeakMap(), _SecurityDetails_validTo = new WeakMap(), _SecurityDetails_protocol = new WeakMap(), _SecurityDetails_sanList = new WeakMap();
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Protocol } from 'devtools-protocol';
|
|
17
|
+
import { Browser, BrowserContext } from './Browser';
|
|
18
|
+
import { CDPSession } from './Connection';
|
|
19
|
+
import { Page } from './Page';
|
|
20
|
+
import { Viewport } from './PuppeteerViewport';
|
|
21
|
+
export declare class Target {
|
|
22
|
+
#private;
|
|
23
|
+
_initializedPromise: Promise<boolean>;
|
|
24
|
+
_initializedCallback: (x: boolean) => void;
|
|
25
|
+
_isClosedPromise: Promise<void>;
|
|
26
|
+
_closedCallback: () => void;
|
|
27
|
+
_isInitialized: boolean;
|
|
28
|
+
_targetId: string;
|
|
29
|
+
constructor(targetInfo: Protocol.Target.TargetInfo, browserContext: BrowserContext, sessionFactory: () => Promise<CDPSession>, defaultViewport: Viewport);
|
|
30
|
+
/**
|
|
31
|
+
* Creates a Chrome Devtools Protocol session attached to the target.
|
|
32
|
+
*/
|
|
33
|
+
createCDPSession(): Promise<CDPSession>;
|
|
34
|
+
_getTargetInfo(): Protocol.Target.TargetInfo;
|
|
35
|
+
/**
|
|
36
|
+
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
37
|
+
*/
|
|
38
|
+
page(): Promise<Page | null>;
|
|
39
|
+
url(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Identifies what kind of target this is.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
*
|
|
45
|
+
* See {@link https://developer.chrome.com/extensions/background_pages | docs} for more info about background pages.
|
|
46
|
+
*/
|
|
47
|
+
type(): 'page' | 'background_page' | 'service_worker' | 'shared_worker' | 'other' | 'browser' | 'webview';
|
|
48
|
+
/**
|
|
49
|
+
* Get the browser the target belongs to.
|
|
50
|
+
*/
|
|
51
|
+
browser(): Browser;
|
|
52
|
+
/**
|
|
53
|
+
* Get the browser context the target belongs to.
|
|
54
|
+
*/
|
|
55
|
+
browserContext(): BrowserContext;
|
|
56
|
+
/**
|
|
57
|
+
* Get the target that opened this target. Top-level targets return `null`.
|
|
58
|
+
*/
|
|
59
|
+
opener(): Target | undefined;
|
|
60
|
+
_targetInfoChanged(targetInfo: Protocol.Target.TargetInfo): void;
|
|
61
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _Target_browserContext, _Target_targetInfo, _Target_sessionFactory, _Target_defaultViewport, _Target_pagePromise;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Target = void 0;
|
|
31
|
+
const Page_1 = require("./Page");
|
|
32
|
+
const isPagetTarget = (target) => {
|
|
33
|
+
return (target.type === 'page' ||
|
|
34
|
+
target.type === 'background_page' ||
|
|
35
|
+
target.type === 'webview');
|
|
36
|
+
};
|
|
37
|
+
class Target {
|
|
38
|
+
constructor(targetInfo, browserContext, sessionFactory, defaultViewport) {
|
|
39
|
+
_Target_browserContext.set(this, void 0);
|
|
40
|
+
_Target_targetInfo.set(this, void 0);
|
|
41
|
+
_Target_sessionFactory.set(this, void 0);
|
|
42
|
+
_Target_defaultViewport.set(this, void 0);
|
|
43
|
+
_Target_pagePromise.set(this, void 0);
|
|
44
|
+
__classPrivateFieldSet(this, _Target_targetInfo, targetInfo, "f");
|
|
45
|
+
__classPrivateFieldSet(this, _Target_browserContext, browserContext, "f");
|
|
46
|
+
this._targetId = targetInfo.targetId;
|
|
47
|
+
__classPrivateFieldSet(this, _Target_sessionFactory, sessionFactory, "f");
|
|
48
|
+
__classPrivateFieldSet(this, _Target_defaultViewport, defaultViewport, "f");
|
|
49
|
+
this._initializedPromise = new Promise((fulfill) => {
|
|
50
|
+
this._initializedCallback = fulfill;
|
|
51
|
+
}).then((success) => {
|
|
52
|
+
if (!success) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const opener = this.opener();
|
|
56
|
+
if (!opener || !__classPrivateFieldGet(opener, _Target_pagePromise, "f") || this.type() !== 'page') {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
});
|
|
61
|
+
this._isClosedPromise = new Promise((fulfill) => {
|
|
62
|
+
this._closedCallback = fulfill;
|
|
63
|
+
});
|
|
64
|
+
this._isInitialized =
|
|
65
|
+
!isPagetTarget(__classPrivateFieldGet(this, _Target_targetInfo, "f")) || __classPrivateFieldGet(this, _Target_targetInfo, "f").url !== '';
|
|
66
|
+
if (this._isInitialized) {
|
|
67
|
+
this._initializedCallback(true);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Creates a Chrome Devtools Protocol session attached to the target.
|
|
72
|
+
*/
|
|
73
|
+
createCDPSession() {
|
|
74
|
+
return __classPrivateFieldGet(this, _Target_sessionFactory, "f").call(this);
|
|
75
|
+
}
|
|
76
|
+
_getTargetInfo() {
|
|
77
|
+
return __classPrivateFieldGet(this, _Target_targetInfo, "f");
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* If the target is not of type `"page"` or `"background_page"`, returns `null`.
|
|
81
|
+
*/
|
|
82
|
+
async page() {
|
|
83
|
+
var _a;
|
|
84
|
+
if (isPagetTarget(__classPrivateFieldGet(this, _Target_targetInfo, "f")) && !__classPrivateFieldGet(this, _Target_pagePromise, "f")) {
|
|
85
|
+
__classPrivateFieldSet(this, _Target_pagePromise, __classPrivateFieldGet(this, _Target_sessionFactory, "f").call(this).then((client) => {
|
|
86
|
+
var _a;
|
|
87
|
+
return Page_1.Page._create(client, this, (_a = __classPrivateFieldGet(this, _Target_defaultViewport, "f")) !== null && _a !== void 0 ? _a : null);
|
|
88
|
+
}), "f");
|
|
89
|
+
}
|
|
90
|
+
return (_a = (await __classPrivateFieldGet(this, _Target_pagePromise, "f"))) !== null && _a !== void 0 ? _a : null;
|
|
91
|
+
}
|
|
92
|
+
url() {
|
|
93
|
+
return __classPrivateFieldGet(this, _Target_targetInfo, "f").url;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Identifies what kind of target this is.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
*
|
|
100
|
+
* See {@link https://developer.chrome.com/extensions/background_pages | docs} for more info about background pages.
|
|
101
|
+
*/
|
|
102
|
+
type() {
|
|
103
|
+
const { type } = __classPrivateFieldGet(this, _Target_targetInfo, "f");
|
|
104
|
+
if (type === 'page' ||
|
|
105
|
+
type === 'background_page' ||
|
|
106
|
+
type === 'service_worker' ||
|
|
107
|
+
type === 'shared_worker' ||
|
|
108
|
+
type === 'browser' ||
|
|
109
|
+
type === 'webview') {
|
|
110
|
+
return type;
|
|
111
|
+
}
|
|
112
|
+
return 'other';
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the browser the target belongs to.
|
|
116
|
+
*/
|
|
117
|
+
browser() {
|
|
118
|
+
return __classPrivateFieldGet(this, _Target_browserContext, "f").browser();
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Get the browser context the target belongs to.
|
|
122
|
+
*/
|
|
123
|
+
browserContext() {
|
|
124
|
+
return __classPrivateFieldGet(this, _Target_browserContext, "f");
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get the target that opened this target. Top-level targets return `null`.
|
|
128
|
+
*/
|
|
129
|
+
opener() {
|
|
130
|
+
const { openerId } = __classPrivateFieldGet(this, _Target_targetInfo, "f");
|
|
131
|
+
if (!openerId) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
return this.browser()._targets.get(openerId);
|
|
135
|
+
}
|
|
136
|
+
_targetInfoChanged(targetInfo) {
|
|
137
|
+
__classPrivateFieldSet(this, _Target_targetInfo, targetInfo, "f");
|
|
138
|
+
if (!this._isInitialized &&
|
|
139
|
+
(!isPagetTarget(__classPrivateFieldGet(this, _Target_targetInfo, "f")) || __classPrivateFieldGet(this, _Target_targetInfo, "f").url !== '')) {
|
|
140
|
+
this._isInitialized = true;
|
|
141
|
+
this._initializedCallback(true);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.Target = Target;
|
|
146
|
+
_Target_browserContext = new WeakMap(), _Target_targetInfo = new WeakMap(), _Target_sessionFactory = new WeakMap(), _Target_defaultViewport = new WeakMap(), _Target_pagePromise = new WeakMap();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TaskQueue {
|
|
17
|
+
#private;
|
|
18
|
+
constructor();
|
|
19
|
+
postTask<T>(task: () => Promise<T>): Promise<T>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2020 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _TaskQueue_chain;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.TaskQueue = void 0;
|
|
31
|
+
class TaskQueue {
|
|
32
|
+
constructor() {
|
|
33
|
+
_TaskQueue_chain.set(this, void 0);
|
|
34
|
+
__classPrivateFieldSet(this, _TaskQueue_chain, Promise.resolve(), "f");
|
|
35
|
+
}
|
|
36
|
+
postTask(task) {
|
|
37
|
+
const result = __classPrivateFieldGet(this, _TaskQueue_chain, "f").then(task);
|
|
38
|
+
__classPrivateFieldSet(this, _TaskQueue_chain, result.then(() => {
|
|
39
|
+
return undefined;
|
|
40
|
+
}, () => {
|
|
41
|
+
return undefined;
|
|
42
|
+
}), "f");
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.TaskQueue = TaskQueue;
|
|
47
|
+
_TaskQueue_chain = new WeakMap();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2019 Google Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TimeoutSettings {
|
|
17
|
+
#private;
|
|
18
|
+
constructor();
|
|
19
|
+
setDefaultTimeout(timeout: number): void;
|
|
20
|
+
setDefaultNavigationTimeout(timeout: number): void;
|
|
21
|
+
navigationTimeout(): number;
|
|
22
|
+
timeout(): number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2019 Google Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
19
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
21
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
22
|
+
};
|
|
23
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
24
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
25
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
26
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
|
+
};
|
|
28
|
+
var _TimeoutSettings_defaultTimeout, _TimeoutSettings_defaultNavigationTimeout;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.TimeoutSettings = void 0;
|
|
31
|
+
const DEFAULT_TIMEOUT = 30000;
|
|
32
|
+
class TimeoutSettings {
|
|
33
|
+
constructor() {
|
|
34
|
+
_TimeoutSettings_defaultTimeout.set(this, void 0);
|
|
35
|
+
_TimeoutSettings_defaultNavigationTimeout.set(this, void 0);
|
|
36
|
+
__classPrivateFieldSet(this, _TimeoutSettings_defaultTimeout, null, "f");
|
|
37
|
+
__classPrivateFieldSet(this, _TimeoutSettings_defaultNavigationTimeout, null, "f");
|
|
38
|
+
}
|
|
39
|
+
setDefaultTimeout(timeout) {
|
|
40
|
+
__classPrivateFieldSet(this, _TimeoutSettings_defaultTimeout, timeout, "f");
|
|
41
|
+
}
|
|
42
|
+
setDefaultNavigationTimeout(timeout) {
|
|
43
|
+
__classPrivateFieldSet(this, _TimeoutSettings_defaultNavigationTimeout, timeout, "f");
|
|
44
|
+
}
|
|
45
|
+
navigationTimeout() {
|
|
46
|
+
if (__classPrivateFieldGet(this, _TimeoutSettings_defaultNavigationTimeout, "f") !== null) {
|
|
47
|
+
return __classPrivateFieldGet(this, _TimeoutSettings_defaultNavigationTimeout, "f");
|
|
48
|
+
}
|
|
49
|
+
if (__classPrivateFieldGet(this, _TimeoutSettings_defaultTimeout, "f") !== null) {
|
|
50
|
+
return __classPrivateFieldGet(this, _TimeoutSettings_defaultTimeout, "f");
|
|
51
|
+
}
|
|
52
|
+
return DEFAULT_TIMEOUT;
|
|
53
|
+
}
|
|
54
|
+
timeout() {
|
|
55
|
+
if (__classPrivateFieldGet(this, _TimeoutSettings_defaultTimeout, "f") !== null) {
|
|
56
|
+
return __classPrivateFieldGet(this, _TimeoutSettings_defaultTimeout, "f");
|
|
57
|
+
}
|
|
58
|
+
return DEFAULT_TIMEOUT;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.TimeoutSettings = TimeoutSettings;
|
|
62
|
+
_TimeoutSettings_defaultTimeout = new WeakMap(), _TimeoutSettings_defaultNavigationTimeout = new WeakMap();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { CDPSession } from './Connection';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface TracingOptions {
|
|
7
|
+
path?: string;
|
|
8
|
+
screenshots?: boolean;
|
|
9
|
+
categories?: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The Tracing class exposes the tracing audit interface.
|
|
13
|
+
* @remarks
|
|
14
|
+
* You can use `tracing.start` and `tracing.stop` to create a trace file
|
|
15
|
+
* which can be opened in Chrome DevTools or {@link https://chromedevtools.github.io/timeline-viewer/ | timeline viewer}.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```js
|
|
19
|
+
* await page.tracing.start({path: 'trace.json'});
|
|
20
|
+
* await page.goto('https://www.google.com');
|
|
21
|
+
* await page.tracing.stop();
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare class Tracing {
|
|
27
|
+
#private;
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
constructor(client: CDPSession);
|
|
32
|
+
/**
|
|
33
|
+
* Starts a trace for the current page.
|
|
34
|
+
* @remarks
|
|
35
|
+
* Only one trace can be active at a time per browser.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Optional `TracingOptions`.
|
|
38
|
+
*/
|
|
39
|
+
start(options?: TracingOptions): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Stops a trace started with the `start` method.
|
|
42
|
+
* @returns Promise which resolves to buffer with trace data.
|
|
43
|
+
*/
|
|
44
|
+
stop(): Promise<Buffer | undefined>;
|
|
45
|
+
}
|