HTTP/2 301
cache-control: max-age=2592000,public
location: https://firefox-source-docs.mozilla.org/devtools-user/debugger/how_to/debug_eval_sources/index.html
vary: Accept
content-type: text/plain; charset=utf-8
x-cloud-trace-context: 619d40cd0cfa6b9d84c6538e464704cf
date: Sat, 11 Oct 2025 11:58:41 GMT
server: Google Frontend
content-length: 133
via: 1.1 google
x-cache: miss
alt-svc: clear
HTTP/2 200
content-type: text/html; charset="utf-8"
content-length: 19535
date: Sat, 11 Oct 2025 11:58:42 GMT
last-modified: Fri, 10 Oct 2025 10:39:05 GMT
etag: "71486b69b6cc07edde1050b5551023ec"
server: AmazonS3
strict-transport-security: max-age=63072000; includeSubDomains; always
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-frame-options: DENY
referrer-policy: origin
content-security-policy: default-src 'none'; connect-src 'self'; font-src 'self' https://fonts.gstatic.com https://cdn.jsdelivr.net; img-src data: https://firefox-source-docs.mozilla.org/ https://*.google.com https://*.googleapis.com https://*.gstatic.com; media-src 'self' https://www.youtube.com; frame-src 'self' https://www.youtube.com; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com https://unpkg.com https://*.google.com https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://*.google.com
x-cache: Miss from cloudfront
via: 1.1 98668a17fb98afaedf2be4666cac7b04.cloudfront.net (CloudFront)
x-amz-cf-pop: BOM78-P11
x-amz-cf-id: pGLs2QT0IFH1nTGb0FnhBuqNaMQECxug505zW0A9ujkvJI409QZkcA==
Debug eval sources — Firefox Source Docs documentation
Firefox Source Docs
Debug eval sources
You can debug JavaScript code that is evaluated dynamically, either as a string passed to eval() or as a string passed to the Function constructor.
In the video below, we load a page containing a source like this:
var script = `function foo() {
console.log('called foo');
}
//# sourceURL=my-foo.js` ;
eval ( script );
var button = document . getElementById ( "foo" );
button . addEventListener ( "click" , foo , false );
The evaluated string is given the name “my-foo.js” using the //# sourceURL
directive. This source is then listed in the source list pane , and can be opened and debugged like any other source.
VIDEO
The name of the source will also appear in stack traces appearing in the Web Console .
The debugger will also stop at debugger; statements in unnamed eval sources.