Skip to content

Commit

Permalink
docs: correct comment about anonymous script coverage urls (#8914)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Sep 8, 2022
1 parent 0d2d99e commit 7a2d9df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api/puppeteer.coverage.startjscoverage.md
Expand Up @@ -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).
3 changes: 2 additions & 1 deletion src/common/Coverage.ts
Expand Up @@ -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<void> {
return await this.#jsCoverage.start(options);
Expand Down

0 comments on commit 7a2d9df

Please sign in to comment.