From 7a2d9df1469747c75b4a9f240953ba26226acdd4 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Wed, 7 Sep 2022 22:56:26 -0700 Subject: [PATCH] docs: correct comment about anonymous script coverage urls (#8914) --- docs/api/puppeteer.coverage.startjscoverage.md | 2 +- src/common/Coverage.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/api/puppeteer.coverage.startjscoverage.md b/docs/api/puppeteer.coverage.startjscoverage.md index 041897d021d44..1bb6a09e3ba08 100644 --- a/docs/api/puppeteer.coverage.startjscoverage.md +++ b/docs/api/puppeteer.coverage.startjscoverage.md @@ -26,4 +26,4 @@ Promise that resolves when coverage is started. ## Remarks -Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts will have `pptr://__puppeteer_evaluation_script__` as their URL. +Anonymous scripts are ones that don't have an associated url. These are scripts that are dynamically created on the page using `eval` or `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous scripts URL will start with `debugger://VM` (unless a magic //\# sourceURL comment is present, in which case that will the be URL). diff --git a/src/common/Coverage.ts b/src/common/Coverage.ts index a75a772a6980c..a41f7b4709e40 100644 --- a/src/common/Coverage.ts +++ b/src/common/Coverage.ts @@ -142,7 +142,8 @@ export class Coverage { * Anonymous scripts are ones that don't have an associated url. These are * scripts that are dynamically created on the page using `eval` or * `new Function`. If `reportAnonymousScripts` is set to `true`, anonymous - * scripts will have `pptr://__puppeteer_evaluation_script__` as their URL. + * scripts URL will start with `debugger://VM` (unless a magic //# sourceURL + * comment is present, in which case that will the be URL). */ async startJSCoverage(options: JSCoverageOptions = {}): Promise { return await this.#jsCoverage.start(options);