@wdio/lighthouse-service 9.32.0 → 10.0.0-alpha.149

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/build/pwa.d.ts ADDED
@@ -0,0 +1,47 @@
1
+ import type { CDPSession } from 'puppeteer-core';
2
+ import type { Page } from 'puppeteer-core';
3
+ import type { AuditResult, LHAuditResult, PWAAudits } from './types.js';
4
+ interface ManifestIcon {
5
+ src?: string;
6
+ sizes?: string;
7
+ purpose?: string;
8
+ type?: string;
9
+ }
10
+ interface WebAppManifest {
11
+ name?: string;
12
+ short_name?: string;
13
+ start_url?: string;
14
+ display?: string;
15
+ background_color?: string;
16
+ theme_color?: string;
17
+ icons?: ManifestIcon[];
18
+ prefer_related_applications?: boolean;
19
+ }
20
+ interface PWAPageState {
21
+ url: string;
22
+ manifestHref?: string;
23
+ manifest?: WebAppManifest | null;
24
+ manifestParseError?: string;
25
+ viewportContent?: string;
26
+ appleTouchIconHref?: string;
27
+ themeColor?: string;
28
+ innerWidth: number;
29
+ documentWidth: number;
30
+ hasServiceWorker: boolean;
31
+ }
32
+ interface InstallabilityError {
33
+ errorId?: string;
34
+ errorArguments?: Array<{
35
+ name?: string;
36
+ value?: string;
37
+ }>;
38
+ }
39
+ export declare function evaluatePWAChecks(state: PWAPageState, installabilityErrors: InstallabilityError[]): Record<PWAAudits, LHAuditResult>;
40
+ export default class PWAAuditor {
41
+ private _session;
42
+ private _page;
43
+ constructor(_session: CDPSession, _page: Page);
44
+ audit(auditsToBeRun?: PWAAudits[]): Promise<AuditResult>;
45
+ }
46
+ export {};
47
+ //# sourceMappingURL=pwa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../src/pwa.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAG1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AAC,SAAS,EAAE,aAAa,CAAC,CAoErI;AAED,MAAM,CAAC,OAAO,OAAO,UAAU;IAEvB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,KAAK;gBADL,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,IAAI;IAGjB,KAAK,CAAE,aAAa,GAAE,SAAS,EAAyB,GAAG,OAAO,CAAC,WAAW,CAAC;CAexF"}
package/build/types.d.ts CHANGED
@@ -1,11 +1,14 @@
1
- import type { TraceStreamJson } from '@tracerbench/trace-event';
2
- import type { ReportOptions } from 'istanbul-reports';
3
- import type { Totals, CoverageSummaryData } from 'istanbul-lib-coverage';
4
- import type { Viewport } from 'puppeteer-core/lib/esm/puppeteer/common/Viewport.js';
5
- import type { NETWORK_STATES, PWA_AUDITS } from './constants.js';
1
+ import type { Viewport } from 'puppeteer-core';
2
+ import type { NETWORK_STATES, PWA_AUDIT_NAMES } from './constants.js';
6
3
  export interface DevtoolsConfig {
7
4
  coverageReporter?: CoverageReporterOptions;
8
5
  }
6
+ /**
7
+ * Report formats previously provided by `istanbul-reports`.
8
+ * Kept as a local union so the public service options stay strict
9
+ * without depending on Istanbul at runtime.
10
+ */
11
+ export type CoverageReportType = 'clover' | 'cobertura' | 'html-spa' | 'html' | 'json' | 'json-summary' | 'lcov' | 'lcovonly' | 'none' | 'teamcity' | 'text' | 'text-lcov' | 'text-summary';
9
12
  export interface CoverageReporterOptions {
10
13
  /**
11
14
  * whether or not to enable code coverage reporting
@@ -20,7 +23,7 @@ export interface CoverageReporterOptions {
20
23
  * format of report
21
24
  * @default json
22
25
  */
23
- type?: keyof ReportOptions;
26
+ type?: CoverageReportType;
24
27
  /**
25
28
  * Options for coverage report
26
29
  */
@@ -58,58 +61,47 @@ export interface DeviceOptions {
58
61
  osVersion: string;
59
62
  inLandscape: boolean;
60
63
  }
61
- export interface Audit {
62
- audit: (opts: any, context: any) => Promise<any>;
63
- defaultOptions: Record<string, any>;
64
- }
65
- export interface AuditResults {
66
- 'speed-index': MetricsResult;
67
- 'first-contentful-paint': MetricsResult;
68
- 'largest-contentful-paint': MetricsResult;
69
- 'cumulative-layout-shift': MetricsResult;
70
- 'total-blocking-time': MetricsResult;
71
- interactive: MetricsResult;
72
- }
73
- export interface AuditRef {
74
- id: keyof AuditResults;
75
- weight: number;
76
- }
77
64
  export interface MainThreadWorkBreakdownResult {
78
- details: {
79
- items: {
80
- group: string;
81
- duration: number;
82
- }[];
83
- };
84
- }
85
- export interface DiagnosticsResults {
86
- details: {
87
- items: any[];
88
- };
89
- }
90
- export interface ResponseTimeResult {
91
- numericValue: number;
92
- }
93
- export interface MetricsResult {
94
- score: number;
95
- }
96
- export interface MetricsResults {
97
- details: {
98
- items: {
99
- observedDomContentLoaded: number;
100
- observedFirstVisualChange: number;
101
- observedFirstPaint: number;
102
- firstContentfulPaint: number;
103
- firstMeaningfulPaint: number;
104
- largestContentfulPaint: number;
105
- observedLastVisualChange: number;
106
- interactive: number;
107
- observedLoad: number;
108
- speedIndex: number;
109
- totalBlockingTime: number;
110
- maxPotentialFID: number;
111
- }[];
112
- };
65
+ group: string;
66
+ duration: number;
67
+ }
68
+ export interface DiagnosticsResult {
69
+ numRequests?: number;
70
+ numScripts?: number;
71
+ numStylesheets?: number;
72
+ numFonts?: number;
73
+ numTasks?: number;
74
+ numTasksOver10ms?: number;
75
+ numTasksOver25ms?: number;
76
+ numTasksOver50ms?: number;
77
+ numTasksOver100ms?: number;
78
+ numTasksOver500ms?: number;
79
+ rtt?: number;
80
+ throughput?: number;
81
+ maxRtt?: number;
82
+ maxServerLatency?: number;
83
+ totalByteWeight?: number;
84
+ totalTaskTime?: number;
85
+ mainDocumentTransferSize?: number;
86
+ [key: string]: number | undefined;
87
+ }
88
+ export interface PerformanceMetrics {
89
+ timeToFirstByte?: number;
90
+ serverResponseTime?: number;
91
+ domContentLoaded?: number;
92
+ firstVisualChange?: number;
93
+ firstPaint?: number;
94
+ firstContentfulPaint?: number;
95
+ firstMeaningfulPaint?: number;
96
+ largestContentfulPaint?: number;
97
+ lastVisualChange?: number;
98
+ interactive?: number;
99
+ load?: number;
100
+ speedIndex?: number;
101
+ totalBlockingTime?: number;
102
+ maxPotentialFID?: number;
103
+ cumulativeLayoutShift?: number;
104
+ interactionToNextPaint?: number;
113
105
  }
114
106
  export interface LHAuditResult {
115
107
  score: number;
@@ -117,30 +109,16 @@ export interface LHAuditResult {
117
109
  notApplicable?: boolean;
118
110
  numericValue?: number;
119
111
  numericUnit?: string;
120
- displayValue?: {
121
- i18nId: string;
122
- values: any;
123
- formattedDefault: string;
124
- };
112
+ displayValue?: string;
125
113
  details?: any;
114
+ explanation?: string;
126
115
  }
127
116
  export interface AuditResult {
128
117
  passed: boolean;
129
- details: Record<string, LHAuditResult | ErrorAudit>;
130
- }
131
- export interface ErrorAudit {
132
- score: 0;
133
- error: Error;
118
+ details: Record<string, LHAuditResult>;
134
119
  }
135
- export type PWAAudits = keyof typeof PWA_AUDITS;
120
+ export type PWAAudits = typeof PWA_AUDIT_NAMES[number];
136
121
  export type NetworkStates = 'offline' | 'GPRS' | 'Regular 2G' | 'Good 2G' | 'Regular 3G' | 'Good 3G' | 'Regular 4G' | 'DSL' | 'Wifi' | 'online';
137
- export interface Coverage {
138
- lines: Totals;
139
- statements: Totals;
140
- functions: Totals;
141
- branches: Totals;
142
- files: Record<string, CoverageSummaryData>;
143
- }
144
122
  export interface CustomDevice {
145
123
  viewport: Viewport;
146
124
  userAgent: string;
@@ -160,9 +138,48 @@ export interface PerformanceAuditOptions {
160
138
  */
161
139
  cacheEnabled?: boolean;
162
140
  }
163
- export interface GathererDriver {
164
- beginTrace(): Promise<void>;
165
- endTrace(): Promise<TraceStreamJson>;
166
- evaluate(script: Function, args: unknown): Promise<any>;
141
+ /**
142
+ * Subset of a Lighthouse result used by the service commands.
143
+ */
144
+ export interface LighthouseResultLike {
145
+ audits?: Record<string, {
146
+ id?: string;
147
+ score: number | null;
148
+ numericValue?: number;
149
+ displayValue?: string;
150
+ warnings?: unknown[];
151
+ notApplicable?: boolean;
152
+ explanation?: string;
153
+ details?: {
154
+ items?: any[];
155
+ };
156
+ }>;
157
+ categories?: {
158
+ performance?: {
159
+ score: number | null;
160
+ };
161
+ };
162
+ finalDisplayedUrl?: string;
163
+ finalUrl?: string;
164
+ runtimeError?: {
165
+ code?: string;
166
+ message?: string;
167
+ };
168
+ }
169
+ export interface LighthouseFlowResultLike {
170
+ steps: Array<{
171
+ lhr: LighthouseResultLike;
172
+ name?: string;
173
+ }>;
174
+ }
175
+ export interface LighthouseFlow {
176
+ startNavigation: (flags?: Record<string, unknown>) => Promise<void>;
177
+ endNavigation: () => Promise<void>;
178
+ navigate: (url: string | (() => Promise<void>), flags?: Record<string, unknown>) => Promise<void>;
179
+ startTimespan: (flags?: Record<string, unknown>) => Promise<void>;
180
+ endTimespan: () => Promise<void>;
181
+ snapshot: (flags?: Record<string, unknown>) => Promise<void>;
182
+ createFlowResult: () => Promise<LighthouseFlowResultLike>;
183
+ dispose?: () => void;
167
184
  }
168
185
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAA;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEhE,MAAM,WAAW,cAAc;IAC3B,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;CAC7C;AAED,MAAM,WAAW,uBAAuB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,M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AE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjG,aAAa,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjE,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAChC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,gBAAgB,EAAE,MAAM,OAAO,CAAC,wBAAwB,CAAC,CAAA;IACzD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB"}
package/build/utils.d.ts CHANGED
@@ -1,7 +1,19 @@
1
- import type { CDPSession } from 'puppeteer-core/lib/esm/puppeteer/api/CDPSession.js';
2
- import type { Target } from 'puppeteer-core/lib/esm/puppeteer/api/Target.js';
3
1
  import type { RequestPayload } from './handler/network.js';
4
- import type { GathererDriver } from './types.js';
2
+ import type { LighthouseFlowResultLike, LighthouseResultLike } from './types.js';
3
+ interface PuppeteerPageLike {
4
+ url: () => string;
5
+ }
6
+ interface PuppeteerTargetLike<TPage extends PuppeteerPageLike> {
7
+ url: () => string;
8
+ type?: () => string;
9
+ page: () => Promise<TPage | null | undefined>;
10
+ }
11
+ interface PuppeteerBrowserLike<TPage extends PuppeteerPageLike> {
12
+ pages: () => Promise<TPage[]>;
13
+ waitForTarget?: (predicate: (target: PuppeteerTargetLike<TPage>) => boolean | Promise<boolean>) => Promise<{
14
+ page: () => Promise<TPage | null | undefined>;
15
+ } | undefined>;
16
+ }
5
17
  export declare function setUnsupportedCommand(browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): void;
6
18
  /**
7
19
  * Create a sum of a specific key from a list of objects
@@ -16,8 +28,21 @@ export declare function sumByKey(list: RequestPayload[], key: keyof RequestPaylo
16
28
  */
17
29
  export declare function isSupportedUrl(url: string): boolean;
18
30
  /**
19
- * Either request the page list directly from the browser or if Selenium
20
- * or Selenoid is used connect to a target manually
31
+ * Puppeteer 24+ returns a Uint8Array from `page.tracing.stop()`.
32
+ * `Uint8Array#toString()` joins bytes with commas, so decode as UTF-8 first.
21
33
  */
22
- export declare function getLighthouseDriver(session: CDPSession, target: Target): Promise<GathererDriver>;
34
+ export declare function parseTraceBuffer(buffer: Buffer | Uint8Array | string): {
35
+ traceEvents?: unknown[];
36
+ } & Record<string, unknown>;
37
+ /**
38
+ * Chrome's WebDriver BiDi stack and DevTools windows show up as extra Puppeteer
39
+ * pages. Lighthouse must attach to the tab WebdriverIO actually navigates.
40
+ */
41
+ export declare function isInternalBrowserPage(url: string): boolean;
42
+ export declare function resolveAuditablePage<TPage extends PuppeteerPageLike>(pages: TPage[], currentUrl?: string): TPage | undefined;
43
+ export declare function getAuditablePuppeteerPage<TPage extends PuppeteerPageLike>(puppeteer: PuppeteerBrowserLike<TPage>, currentUrl?: string): Promise<TPage | undefined>;
44
+ export declare function hasCorePerformanceMetrics(lhr?: LighthouseResultLike): lhr is LighthouseResultLike;
45
+ export declare function selectLighthouseResult(result?: LighthouseFlowResultLike): LighthouseResultLike | undefined;
46
+ export declare function describeLighthouseResult(lhr?: LighthouseResultLike): string;
47
+ export {};
23
48
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oDAAoD,CAAA;AACpF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAA;AAK5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAahD,wBAAgB,qBAAqB,CAAE,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,QAMnG;AAED;;;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ACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,cAAc,UAE1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAE,GAAG,EAAE,MAAM,WAE1C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAE,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG;IAAE,WAAW,CAAC,EAAE,OAAO,EAAE,CAAA;CAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAY7H;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAE,GAAG,EAAE,MAAM,WAMjD;AAMD,wBAAgB,oBAAoB,CAAC,KAAK,SAAS,iBAAiB,EAChE,KAAK,EAAE,KAAK,EAAE,EACd,UAAU,CAAC,EAAE,MAAM,GACpB,KAAK,GAAG,SAAS,CAUnB;AAED,wBAAsB,yBAAyB,CAAC,KAAK,SAAS,iBAAiB,EAC3E,SAAS,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,KAAK,GAAG,SAAS,CAAC,CAuB5B;AAeD,wBAAgB,yBAAyB,CAAE,GAAG,CAAC,EAAE,oBAAoB,GAAG,GAAG,IAAI,oBAAoB,CAalG;AAED,wBAAgB,sBAAsB,CAAE,MAAM,CAAC,EAAE,wBAAwB,GAAG,oBAAoB,GAAG,SAAS,CAS3G;AAED,wBAAgB,wBAAwB,CAAE,GAAG,CAAC,EAAE,oBAAoB,UAMnE"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@wdio/lighthouse-service",
3
- "version": "9.32.0",
3
+ "version": "10.0.0-alpha.149+ce13bea83",
4
4
  "description": "A WebdriverIO service that allows you to run Chrome DevTools commands in your tests",
5
5
  "author": "Christian Bromann <mail@bromann.dev>",
6
6
  "homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-lighthouse-service",
7
7
  "license": "MIT",
8
8
  "engines": {
9
- "node": ">=18.20.0"
9
+ "node": ">=22.19.0"
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
@@ -38,31 +38,22 @@
38
38
  "import": "./build/index.js"
39
39
  }
40
40
  },
41
- "typeScriptVersion": "3.8.3",
41
+ "typeScriptVersion": "6.0.3",
42
42
  "dependencies": {
43
- "@babel/core": "^7.18.0",
44
43
  "@tracerbench/trace-event": "^8.0.0",
45
- "@types/node": "^20.1.0",
46
- "@wdio/logger": "9.29.1",
47
- "@wdio/types": "9.32.0",
48
- "babel-plugin-istanbul": "^7.0.0",
49
- "devtools-protocol": "^0.0.1646372",
50
- "istanbul-lib-coverage": "^3.2.0",
51
- "istanbul-lib-report": "^3.0.0",
52
- "istanbul-reports": "^3.1.4",
53
- "lighthouse": "8.6.0",
54
- "puppeteer-core": "^24.12.1",
55
- "webdriverio": "9.32.0"
44
+ "@types/node": "^22.20.4",
45
+ "@wdio/logger": "10.0.0-alpha.149+ce13bea83",
46
+ "@wdio/types": "10.0.0-alpha.149+ce13bea83",
47
+ "devtools-protocol": "^0.0.1701330",
48
+ "lighthouse": "13.4.1",
49
+ "puppeteer-core": "^25.11.0",
50
+ "webdriverio": "10.0.0-alpha.149+ce13bea83"
56
51
  },
57
52
  "publishConfig": {
58
53
  "access": "public"
59
54
  },
60
55
  "devDependencies": {
61
- "@types/babel__core": "^7.1.19",
62
- "@types/istanbul-lib-coverage": "^2.0.6",
63
- "@types/istanbul-lib-report": "^3.0.0",
64
- "@types/istanbul-reports": "^3.0.4",
65
- "@wdio/globals": "9.31.3"
56
+ "@wdio/globals": "10.0.0-alpha.149+ce13bea83"
66
57
  },
67
- "gitHead": "5c2a318d9a5e8424a2f2de95df9374b89bda7936"
58
+ "gitHead": "ce13bea839fb037eceda429dbf94cd387b7c3584"
68
59
  }
@@ -1,19 +0,0 @@
1
- export interface CDPSessionOnMessageObject {
2
- id?: number;
3
- method: string;
4
- params: Record<string, unknown>;
5
- error: {
6
- message: string;
7
- data: unknown;
8
- };
9
- result?: unknown;
10
- }
11
- export default class DevtoolsGatherer {
12
- private _logs;
13
- onMessage(msgObj: CDPSessionOnMessageObject): void;
14
- /**
15
- * retrieve logs and clean cache
16
- */
17
- getLogs(): CDPSessionOnMessageObject[];
18
- }
19
- //# sourceMappingURL=devtools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/gatherer/devtools.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,KAAK,EAAE;QACH,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,OAAO,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,OAAO,gBAAgB;IACjC,OAAO,CAAC,KAAK,CAAkC;IAE/C,SAAS,CAAE,MAAM,EAAE,yBAAyB;IAI5C;;OAEG;IACH,OAAO;CAGV"}
@@ -1,28 +0,0 @@
1
- import type { CDPSession } from 'puppeteer-core/lib/esm/puppeteer/api/CDPSession.js';
2
- import type { Page } from 'puppeteer-core/lib/esm/puppeteer/api/Page.js';
3
- import type { GathererDriver } from '../types.js';
4
- export default class PWAGatherer {
5
- private _session;
6
- private _page;
7
- private _driver;
8
- private _frGatherer;
9
- private _networkRecorder;
10
- private _networkRecords;
11
- constructor(_session: CDPSession, _page: Page, _driver: GathererDriver);
12
- gatherData(): Promise<{
13
- URL: {
14
- requestedUrl: string;
15
- finalUrl: string;
16
- };
17
- WebAppManifest: any;
18
- InstallabilityErrors: any;
19
- MetaElements: any;
20
- ViewportDimensions: any;
21
- ServiceWorker: {
22
- versions: any;
23
- registrations: any;
24
- };
25
- LinkElements: any;
26
- }>;
27
- }
28
- //# sourceMappingURL=pwa.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../../src/gatherer/pwa.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oDAAoD,CAAA;AACpF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAA;AAIxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,CAAC,OAAO,OAAO,WAAW;IAMxB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO;IAPnB,OAAO,CAAC,WAAW,CAAmB;IACtC,OAAO,CAAC,gBAAgB,CAAwB;IAChD,OAAO,CAAC,eAAe,CAA+B;gBAG1C,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,cAAc;IAsB7B,UAAU;;;;;;;;;;;;;;;CA4BnB"}
@@ -1,60 +0,0 @@
1
- import { EventEmitter } from 'node:events';
2
- import type { Protocol } from 'devtools-protocol';
3
- import type { TraceEvent } from '@tracerbench/trace-event';
4
- import type { HTTPRequest } from 'puppeteer-core/lib/esm/puppeteer/api/HTTPRequest.js';
5
- import type { CDPSession } from 'puppeteer-core/lib/esm/puppeteer/api/CDPSession.js';
6
- import type { Page } from 'puppeteer-core/lib/esm/puppeteer/api/Page.js';
7
- import type { GathererDriver } from '../types.js';
8
- export interface Trace {
9
- traceEvents: TraceEvent[];
10
- frameId?: string;
11
- loaderId?: string;
12
- pageUrl?: string;
13
- traceStart?: number;
14
- traceEnd?: number;
15
- }
16
- export interface WaitPromise {
17
- promise: Promise<unknown>;
18
- cancel: Function;
19
- }
20
- export default class TraceGatherer extends EventEmitter {
21
- private _session;
22
- private _page;
23
- private _driver;
24
- private _failingFrameLoadIds;
25
- private _pageLoadDetected;
26
- private _networkListeners;
27
- private _frameId?;
28
- private _loaderId?;
29
- private _pageUrl?;
30
- private _networkStatusMonitor;
31
- private _networkMonitor;
32
- private _protocolSession;
33
- private _trace?;
34
- private _traceStart?;
35
- private _clickTraceTimeout?;
36
- private _waitConditionPromises;
37
- constructor(_session: CDPSession, _page: Page, _driver: GathererDriver);
38
- startTracing(url: string): Promise<void>;
39
- /**
40
- * store frame id of frames that are being traced
41
- */
42
- onFrameNavigated(msgObj: Protocol.Page.FrameNavigatedEvent): Promise<void>;
43
- /**
44
- * once the page load event has fired, we can grab some performance
45
- * metrics and timing
46
- */
47
- onLoadEventFired(): Promise<void>;
48
- onFrameLoadFail(request: HTTPRequest): void;
49
- get isTracing(): boolean;
50
- /**
51
- * once tracing has finished capture trace logs into memory
52
- */
53
- completeTracing(): Promise<void>;
54
- /**
55
- * clear tracing states and emit tracingFinished
56
- */
57
- finishTracing(): void;
58
- waitForMaxTimeout(maxWaitForLoadedMs?: number): Promise<() => Promise<void>>;
59
- }
60
- //# sourceMappingURL=trace.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/gatherer/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAO1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,0BAA0B,CAAA;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qDAAqD,CAAA;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oDAAoD,CAAA;AACpF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8CAA8C,CAAA;AASxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,MAAM,WAAW,KAAK;IAClB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UA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
3
- * this class got patched to enable connecting to a remote path like
4
- * ws://192.168.0.39:4444/session/349a44a32846c2659c703e71403bd472/se/cdp
5
- * as it requires to attach to a session before.
6
- */
7
- export default class ChromeProtocolPatched extends CriConnection {
8
- private _sessionId?;
9
- /**
10
- * Add constructor for typing safety
11
- * @param {number=} port Optional port number. Defaults to 9222;
12
- * @param {string=} hostname Optional hostname. Defaults to localhost.
13
- * @constructor
14
- */
15
- constructor(port?: string, hostname?: string);
16
- setSessionId(sessionId: string): void;
17
- /**
18
- * force every command to be send with the given session id
19
- */
20
- sendCommand(method: string, sessionId?: string, ...paramArgs: unknown[]): any;
21
- }
22
- //# sourceMappingURL=cri.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cri.d.ts","sourceRoot":"","sources":["../../src/lighthouse/cri.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,sDAAsD,CAAA;AAKhF;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,aAAa;IAC5D,OAAO,CAAC,UAAU,CAAC,CAAQ;IAE3B;;;;;OAKG;gBACS,IAAI,GAAE,MAAqB,EAAE,QAAQ,GAAE,MAAyB;IAI5E,YAAY,CAAE,SAAS,EAAE,MAAM;IAI/B;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE;CAG1E"}
@@ -1,8 +0,0 @@
1
- export default function collectMetaElements(): {
2
- name: any;
3
- content: any;
4
- property: string | undefined;
5
- httpEquiv: any;
6
- charset: string | undefined;
7
- }[];
8
- //# sourceMappingURL=collectMetaElements.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"collectMetaElements.d.ts","sourceRoot":"","sources":["../../src/scripts/collectMetaElements.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,mBAAmB;;;;;;IAuC1C"}
@@ -1,12 +0,0 @@
1
- declare global {
2
- interface Window {
3
- ____lastLongTask: number;
4
- ____lhPerformanceObserver: PerformanceObserver;
5
- }
6
- }
7
- /**
8
- * Used by _waitForCPUIdle and executed in the context of the page, updates the ____lastLongTask
9
- * property on window to the end time of the last long task.
10
- */
11
- export default function registerPerformanceObserverInPage(): void;
12
- //# sourceMappingURL=registerPerformanceObserverInPage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registerPerformanceObserverInPage.d.ts","sourceRoot":"","sources":["../../src/scripts/registerPerformanceObserverInPage.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,gBAAgB,EAAE,MAAM,CAAA;QACxB,yBAAyB,EAAE,mBAAmB,CAAA;KACjD;CACJ;AAED;;;GAGG;AAEH,MAAM,CAAC,OAAO,UAAU,iCAAiC,SAmBxD"}