Skip to content

Commit 9369111

Browse files
chore(deps-dev): bump puppeteer from 24.40.0 to 24.41.0 in the bundled group (#1869)
Bumps the bundled group with 1 update: [puppeteer](https://github.com/puppeteer/puppeteer). Updates `puppeteer` from 24.40.0 to 24.41.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/puppeteer/puppeteer/releases">puppeteer's releases</a>.</em></p> <blockquote> <h2>puppeteer-core: v24.41.0</h2> <h2><a href="https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.40.0...puppeteer-core-v24.41.0">24.41.0</a> (2026-04-15)</h2> <h3>🎉 Features</h3> <ul> <li>add support for Issues (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14845">#14845</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6e8dbe7a998a3619f089f549009ebcb860389fdd">6e8dbe7</a>)</li> <li>adds extension realms api (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14824">#14824</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/c14f4ae7ee65fd95a4a1f9d722e73f67c37da44b">c14f4ae</a>)</li> <li>API to list installed browser extensions and trigger extension actions (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14821">#14821</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/d6395ef88103a50cb2b2c43f61953ab6a495a8c3">d6395ef</a>)</li> <li>implement console event on web workers (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14784">#14784</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/fa6158a1dfa327df8dc8eea1eb22c49efefb3be5">fa6158a</a>)</li> <li>roll to Chrome 147.0.7727.24 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14797">#14797</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/ee81786a8285e20afdee70e4fb8660df4d6748b0">ee81786</a>)</li> <li>roll to Firefox 149.0 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14799">#14799</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/9fd5ceb054b0508bd8f4b14ed950a011a31f101a">9fd5ceb</a>)</li> <li><strong>webmcp:</strong> add hook for tool invocation (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14835">#14835</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/cf8169d5dee0bbff06118c211969eb94849f6bbd">cf8169d</a>)</li> <li><strong>webmcp:</strong> add hook for tool response (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14841">#14841</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6fb05bc9e45fb2735a1c44b59ad868af2fb1ee9b">6fb05bc</a>)</li> <li><strong>webmcp:</strong> add initial API to inspect tool registrations (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14814">#14814</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/655c996fed21d4ac7f5df841aef0c6b246ba2e9d">655c996</a>)</li> <li><strong>webmcp:</strong> add WebMCPTool execute support (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14851">#14851</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/8f95117960af969ee31595406f985c924eb67bf1">8f95117</a>)</li> <li><strong>webmcp:</strong> expose WebMCPToolCall in WebMCPToolCallResult (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14848">#14848</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/242ac0b2d364e9463f2b0e37f26d8bd0cfdf4d3e">242ac0b</a>)</li> <li><strong>webmcp:</strong> Switch from WebMCPInvocationStatus Success to Completed (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14859">#14859</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/375e636beedaa5fef53d5f198fa70229d47155b5">375e636</a>)</li> </ul> <h3>🛠️ Fixes</h3> <ul> <li>add missing onRelease to Mutex and add tests (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14818">#14818</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/bf1e9722eef723c80250119d81fd9d9e0596c074">bf1e972</a>)</li> <li>make <code>Target.asPage</code> return the same Page instance (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14862">#14862</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/e484a918c432859efbf57a74b4957097b13f8575">e484a91</a>)</li> <li>remove RenderDocument from disabled Chrome features (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14745">#14745</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/a48eba24dcb2663da543bdf1f4597a2c1a56f0ff">a48eba2</a>)</li> <li>roll to Chrome 147.0.7727.50 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14819">#14819</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/2be30023994ee2e7ebb15e43dc0e2804256f8ca2">2be3002</a>)</li> <li>roll to Chrome 147.0.7727.56 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14842">#14842</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/fdb3c64f8bfcff367eab862c0309f9c4bf6d6f20">fdb3c64</a>)</li> <li>roll to Firefox 149.0.2 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14838">#14838</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/55359a3d7383c03a9d9de7ff8e24b613655694e8">55359a3</a>)</li> <li>without azimuthAngle the altitudeAngle should no be specified (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14781">#14781</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6f9d9752207d55be0e3b0d10ba9a416a81af4694">6f9d975</a>)</li> </ul> <h3>📄 Documentation</h3> <ul> <li>update extension and realm docs (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14867">#14867</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/080379bf24c6bd021d664bcf993457542cf76dcc">080379b</a>)</li> <li><strong>webmcp:</strong> Add JS example to WebMCP class (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14852">#14852</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/c514dba3316e742f2d2b428fd72a49890c0a2255">c514dba</a>)</li> <li><strong>webmcp:</strong> Add missing documentation (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14849">#14849</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/76b08d20305283b9a2a2ccd5cf9c2f5bad63e337">76b08d2</a>)</li> <li><strong>webmcp:</strong> tune tags and descriptions (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14844">#14844</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/578295815ca559790626b8aeeddeea9f9cef67be">5782958</a>)</li> </ul> <h2>puppeteer: v24.41.0</h2> <h2><a href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.40.0...puppeteer-v24.41.0">24.41.0</a> (2026-04-15)</h2> <h3>🎉 Features</h3> <ul> <li>roll to Chrome 147.0.7727.24 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14797">#14797</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/ee81786a8285e20afdee70e4fb8660df4d6748b0">ee81786</a>)</li> </ul> <h3>Dependencies</h3> <ul> <li>The following workspace dependencies were updated</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md">puppeteer's changelog</a>.</em></p> <blockquote> <h2><a href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.40.0...puppeteer-v24.41.0">24.41.0</a> (2026-04-15)</h2> <h3>🎉 Features</h3> <ul> <li>add support for Issues (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14845">#14845</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6e8dbe7a998a3619f089f549009ebcb860389fdd">6e8dbe7</a>)</li> <li>adds extension realms api (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14824">#14824</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/c14f4ae7ee65fd95a4a1f9d722e73f67c37da44b">c14f4ae</a>)</li> <li>API to list installed browser extensions and trigger extension actions (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14821">#14821</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/d6395ef88103a50cb2b2c43f61953ab6a495a8c3">d6395ef</a>)</li> <li>implement console event on web workers (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14784">#14784</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/fa6158a1dfa327df8dc8eea1eb22c49efefb3be5">fa6158a</a>)</li> <li>roll to Chrome 147.0.7727.24 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14797">#14797</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/ee81786a8285e20afdee70e4fb8660df4d6748b0">ee81786</a>)</li> <li>roll to Firefox 149.0 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14799">#14799</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/9fd5ceb054b0508bd8f4b14ed950a011a31f101a">9fd5ceb</a>)</li> <li><strong>webmcp:</strong> add hook for tool invocation (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14835">#14835</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/cf8169d5dee0bbff06118c211969eb94849f6bbd">cf8169d</a>)</li> <li><strong>webmcp:</strong> add hook for tool response (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14841">#14841</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6fb05bc9e45fb2735a1c44b59ad868af2fb1ee9b">6fb05bc</a>)</li> <li><strong>webmcp:</strong> add initial API to inspect tool registrations (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14814">#14814</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/655c996fed21d4ac7f5df841aef0c6b246ba2e9d">655c996</a>)</li> <li><strong>webmcp:</strong> add WebMCPTool execute support (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14851">#14851</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/8f95117960af969ee31595406f985c924eb67bf1">8f95117</a>)</li> <li><strong>webmcp:</strong> expose WebMCPToolCall in WebMCPToolCallResult (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14848">#14848</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/242ac0b2d364e9463f2b0e37f26d8bd0cfdf4d3e">242ac0b</a>)</li> <li><strong>webmcp:</strong> Switch from WebMCPInvocationStatus Success to Completed (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14859">#14859</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/375e636beedaa5fef53d5f198fa70229d47155b5">375e636</a>)</li> </ul> <h3>Dependencies</h3> <ul> <li>The following workspace dependencies were updated <ul> <li>dependencies <ul> <li>puppeteer-core bumped from 24.40.0 to 24.41.0</li> </ul> </li> </ul> </li> </ul> <h3>🛠️ Fixes</h3> <ul> <li>add missing onRelease to Mutex and add tests (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14818">#14818</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/bf1e9722eef723c80250119d81fd9d9e0596c074">bf1e972</a>)</li> <li>make <code>Target.asPage</code> return the same Page instance (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14862">#14862</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/e484a918c432859efbf57a74b4957097b13f8575">e484a91</a>)</li> <li>remove RenderDocument from disabled Chrome features (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14745">#14745</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/a48eba24dcb2663da543bdf1f4597a2c1a56f0ff">a48eba2</a>)</li> <li>roll to Chrome 147.0.7727.50 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14819">#14819</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/2be30023994ee2e7ebb15e43dc0e2804256f8ca2">2be3002</a>)</li> <li>roll to Chrome 147.0.7727.56 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14842">#14842</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/fdb3c64f8bfcff367eab862c0309f9c4bf6d6f20">fdb3c64</a>)</li> <li>roll to Firefox 149.0.2 (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14838">#14838</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/55359a3d7383c03a9d9de7ff8e24b613655694e8">55359a3</a>)</li> <li>without azimuthAngle the altitudeAngle should no be specified (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14781">#14781</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/6f9d9752207d55be0e3b0d10ba9a416a81af4694">6f9d975</a>)</li> </ul> <h3>📄 Documentation</h3> <ul> <li>update extension and realm docs (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14867">#14867</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/080379bf24c6bd021d664bcf993457542cf76dcc">080379b</a>)</li> <li><strong>webmcp:</strong> Add JS example to WebMCP class (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14852">#14852</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/c514dba3316e742f2d2b428fd72a49890c0a2255">c514dba</a>)</li> <li><strong>webmcp:</strong> Add missing documentation (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14849">#14849</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/76b08d20305283b9a2a2ccd5cf9c2f5bad63e337">76b08d2</a>)</li> <li><strong>webmcp:</strong> tune tags and descriptions (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14844">#14844</a>) (<a href="https://github.com/puppeteer/puppeteer/commit/578295815ca559790626b8aeeddeea9f9cef67be">5782958</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/puppeteer/puppeteer/commit/2d05dfcfa321f7e6289e4658cd6f0cced3d62fe2"><code>2d05dfc</code></a> fix: bump node to 24 to avoid publishing bugs with npm (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14868">#14868</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/20402bc0f9a7daeee2afc6a9859a55ff9bf0e391"><code>20402bc</code></a> chore: release main (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14866">#14866</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/080379bf24c6bd021d664bcf993457542cf76dcc"><code>080379b</code></a> docs: update extension and realm docs (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14867">#14867</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/1f9dc746565c818d59fff9e84c3c795ddd2ec32d"><code>1f9dc74</code></a> chore(deps): bump follow-redirects from 1.15.11 to 1.16.0 in /website (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14865">#14865</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/4655500ac52c67c782a956ea66270dfcf5a38d91"><code>4655500</code></a> chore(deps-dev): bump the dev-dependencies group with 8 updates (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14855">#14855</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/d5029415e2c3d83ed340cf29733662e9f0b58434"><code>d502941</code></a> test: fix extension test flakiness (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14864">#14864</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/e484a918c432859efbf57a74b4957097b13f8575"><code>e484a91</code></a> fix: make <code>Target.asPage</code> return the same Page instance (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14862">#14862</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/c14f4ae7ee65fd95a4a1f9d722e73f67c37da44b"><code>c14f4ae</code></a> feat: adds extension realms api (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14824">#14824</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/5097b97d07eb0e3c68d99fce80efe899084a313d"><code>5097b97</code></a> test: fix flaky extension test (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14853">#14853</a>)</li> <li><a href="https://github.com/puppeteer/puppeteer/commit/8f95117960af969ee31595406f985c924eb67bf1"><code>8f95117</code></a> feat(webmcp): add WebMCPTool execute support (<a href="https://redirect.github.com/puppeteer/puppeteer/issues/14851">#14851</a>)</li> <li>Additional commits viewable in <a href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v24.40.0...puppeteer-v24.41.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=puppeteer&package-manager=npm_and_yarn&previous-version=24.40.0&new-version=24.41.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
1 parent 528309a commit 9369111

5 files changed

Lines changed: 29 additions & 58 deletions

File tree

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"globals": "^17.0.0",
7070
"lighthouse": "13.1.0",
7171
"prettier": "^3.6.2",
72-
"puppeteer": "24.40.0",
72+
"puppeteer": "24.41.0",
7373
"rollup": "4.60.1",
7474
"rollup-plugin-cleanup": "^3.2.1",
7575
"rollup-plugin-license": "^3.6.0",

src/McpContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class McpContext implements Context {
117117
uncaughtError: event => {
118118
collect(event);
119119
},
120-
issue: event => {
120+
devtoolsAggregatedIssue: event => {
121121
collect(event);
122122
},
123123
} as ListenerMap;

src/PageCollector.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import type {
1111
CDPSession,
1212
ConsoleMessage,
1313
Protocol,
14+
Issue,
1415
} from './third_party/index.js';
1516
import {DevTools} from './third_party/index.js';
1617
import {
@@ -33,7 +34,7 @@ export class UncaughtError {
3334
}
3435

3536
interface PageEvents extends PuppeteerPageEvents {
36-
issue: DevTools.AggregatedIssue;
37+
devtoolsAggregatedIssue: DevTools.AggregatedIssue;
3738
uncaughtError: UncaughtError;
3839
}
3940

@@ -285,7 +286,7 @@ class PageEventSubscriber {
285286
async subscribe() {
286287
this.#resetIssueAggregator();
287288
this.#page.on('framenavigated', this.#onFrameNavigated);
288-
this.#session.on('Audits.issueAdded', this.#onIssueAdded);
289+
this.#page.on('issue', this.#onIssueAdded);
289290
this.#session.on('Runtime.exceptionThrown', this.#onExceptionThrown);
290291
try {
291292
await this.#session.send('Audits.enable');
@@ -298,7 +299,7 @@ class PageEventSubscriber {
298299
this.#seenKeys.clear();
299300
this.#seenIssues.clear();
300301
this.#page.off('framenavigated', this.#onFrameNavigated);
301-
this.#session.off('Audits.issueAdded', this.#onIssueAdded);
302+
this.#page.off('issue', this.#onIssueAdded);
302303
this.#session.off('Runtime.exceptionThrown', this.#onExceptionThrown);
303304
if (this.#issueAggregator) {
304305
this.#issueAggregator.removeEventListener(
@@ -318,7 +319,7 @@ class PageEventSubscriber {
318319
return;
319320
}
320321
this.#seenIssues.add(event.data);
321-
this.#page.emit('issue', event.data);
322+
this.#page.emit('devtoolsAggregatedIssue', event.data);
322323
};
323324

324325
#onExceptionThrown = (event: Protocol.Runtime.ExceptionThrownEvent) => {
@@ -339,9 +340,8 @@ class PageEventSubscriber {
339340
this.#resetIssueAggregator();
340341
};
341342

342-
#onIssueAdded = (data: Protocol.Audits.IssueAddedEvent) => {
343+
#onIssueAdded = (inspectorIssue: Issue) => {
343344
try {
344-
const inspectorIssue = data.issue;
345345
const issue = DevTools.createIssuesFromProtocolIssue(
346346
null,
347347
// @ts-expect-error Protocol types diverge.

tests/PageCollector.test.ts

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -329,40 +329,13 @@ describe('ConsoleCollector', () => {
329329
sinon.restore();
330330
});
331331

332-
it('emits issues on page', async () => {
333-
const browser = getMockBrowser();
334-
const page = (await browser.pages())[0];
335-
// @ts-expect-error internal API.
336-
const cdpSession = page._client();
337-
const onIssuesListener = sinon.spy();
338-
339-
page.on('issue', onIssuesListener);
340-
341-
const collector = new ConsoleCollector(browser, collect => {
342-
return {
343-
issue: issue => {
344-
collect(issue as DevTools.AggregatedIssue);
345-
},
346-
} as ListenerMap;
347-
});
348-
await collector.init([page]);
349-
cdpSession.emit('Audits.issueAdded', {issue});
350-
sinon.assert.calledOnce(onIssuesListener);
351-
352-
const issueArgument = onIssuesListener.getCall(0).args[0];
353-
assert(issueArgument instanceof DevTools.AggregatedIssue);
354-
});
355-
356332
it('collects issues', async () => {
357333
const browser = getMockBrowser();
358334
const page = (await browser.pages())[0];
359-
// @ts-expect-error internal API.
360-
const cdpSession = page._client();
361-
362335
const collector = new ConsoleCollector(browser, collect => {
363336
return {
364-
issue: issue => {
365-
collect(issue as DevTools.AggregatedIssue);
337+
devtoolsAggregatedIssue: issue => {
338+
collect(issue);
366339
},
367340
} as ListenerMap;
368341
});
@@ -379,29 +352,27 @@ describe('ConsoleCollector', () => {
379352
},
380353
} satisfies Protocol.Audits.InspectorIssue;
381354

382-
cdpSession.emit('Audits.issueAdded', {issue});
383-
cdpSession.emit('Audits.issueAdded', {issue: issue2});
355+
page.emit('issue', issue);
356+
page.emit('issue', issue2);
384357
const data = collector.getData(page);
385358
assert.equal(data.length, 2);
386359
});
387360

388361
it('filters duplicated issues', async () => {
389362
const browser = getMockBrowser();
390363
const page = (await browser.pages())[0];
391-
// @ts-expect-error internal API.
392-
const cdpSession = page._client();
393364

394365
const collector = new ConsoleCollector(browser, collect => {
395366
return {
396-
issue: issue => {
397-
collect(issue as DevTools.AggregatedIssue);
367+
devtoolsAggregatedIssue: issue => {
368+
collect(issue);
398369
},
399370
} as ListenerMap;
400371
});
401372
await collector.init([page]);
402373

403-
cdpSession.emit('Audits.issueAdded', {issue});
404-
cdpSession.emit('Audits.issueAdded', {issue});
374+
page.emit('issue', issue);
375+
page.emit('issue', issue);
405376
const data = collector.getData(page);
406377
assert.equal(data.length, 1);
407378
const collectedIssue = data[0];

0 commit comments

Comments
 (0)