Skip to content

Commit

Permalink
feat: use absolute URL for EVALUATION_SCRIPT_URL (#8481)
Browse files Browse the repository at this point in the history
Closes #8424
  • Loading branch information
OrKoN committed Jun 7, 2022
1 parent 96b416c commit e142560
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/api.md
Expand Up @@ -5482,7 +5482,7 @@ see [puppeteer-to-istanbul](https://github.com/istanbuljs/puppeteer-to-istanbul)
- `reportAnonymousScripts` <[boolean]> Whether anonymous scripts generated by the page should be reported. Defaults to `false`.
- returns: <[Promise]> Promise that resolves when coverage is started

> **NOTE** 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 `__puppeteer_evaluation_script__` as their URL.
> **NOTE** 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.
#### coverage.stopCSSCoverage()

Expand Down
2 changes: 1 addition & 1 deletion src/common/Coverage.ts
Expand Up @@ -146,7 +146,7 @@ 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 `__puppeteer_evaluation_script__` as their URL.
* scripts will have `pptr://__puppeteer_evaluation_script__` as their URL.
*/
async startJSCoverage(options: JSCoverageOptions = {}): Promise<void> {
return await this._jsCoverage.start(options);
Expand Down
2 changes: 1 addition & 1 deletion src/common/ExecutionContext.ts
Expand Up @@ -25,7 +25,7 @@ import { EvaluateHandleFn, SerializableOrJSHandle } from './EvalTypes.js';
/**
* @public
*/
export const EVALUATION_SCRIPT_URL = '__puppeteer_evaluation_script__';
export const EVALUATION_SCRIPT_URL = 'pptr://__puppeteer_evaluation_script__';
const SOURCE_URL_REGEX = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m;

/**
Expand Down

0 comments on commit e142560

Please sign in to comment.