Repository navigation
Implement upstream PR #14821: browser extensions API - #3404
Merged
Merged
Conversation
7 tasks done
Ports puppeteer/puppeteer#14821 to PuppeteerSharp. - Rename GetExtensionsAsync to ExtensionsAsync (IBrowser, Browser, CdpBrowser, BidiBrowser, IsolatedWorld) to match upstream naming. - Add TriggerExtensionActionAsync abstract method (IPage, Page, CdpPage; BidiPage throws NotSupportedException). - Filter extension targets in CdpBrowser.Targets() and target event handlers via IsTargetExposed. - Use AsPageAsync (with try/catch for closed targets) in CdpExtension.PagesAsync. - Add ExtensionsTests covering the new API surface. - Add extension-with-page test asset (background.js, manifest.json, popup.html). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
kblok
force-pushed
the
implement-upstream-change-14821
branch
from
May 10, 2026 22:15
b659cd4 to
c56896c
Compare
Extensions.triggerAction expects a tab target id, but Page._tabId was
falling back to the page's own session because pages auto-attached at
the connection level. Adding `{type:'page', exclude:true}` to the
browser-level setAutoAttach matches upstream and routes pages through
their owning tab session, so TabId is now correct.
That change exposed two latent bugs:
- Prerender activation re-emits a navigation request on the new session
but never produces an HTTP response, so LifecycleWatcher hung waiting
on _navigationResponseReceived. FrameSwapped now resolves it.
- Connection.Dispose can be re-entered from the Disconnected callback
while a message is mid-flight, deadlocking on the TaskQueue
semaphore. Bounded the dispose wait to 1s; in-flight tasks already
tolerate a disposed semaphore.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…r test With the previous commit's filter, tab targets auto-attach. The DevTools tab target's URL matches isDevToolsPageTarget so we wrap it as a CdpDevToolsTarget — and that class hard-overrode Type to TargetType.Other, making Targets()/PagesAsync() treat the tab as a page, then try to send Page.enable on a tab session. Removing the override matches upstream (DevToolsTarget extends PageTarget with no type override). ShouldHandleTargets was written for the pre-filter world where tabs weren't attached. Synced it to upstream's version, which accounts for the tab/page pair on each new page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 20, 2026
This was referenced Jun 2, 2026
sondresjolyst
added a commit
to sondresjolyst/garge-api
that referenced
this pull request
Jun 8, 2026
Updated [PuppeteerSharp](https://github.com/hardkoded/puppeteer-sharp) from 24.42.0 to 25.0.4. <details> <summary>Release notes</summary> _Sourced from [PuppeteerSharp's releases](https://github.com/hardkoded/puppeteer-sharp/releases)._ ## 25.0.4 ## What's New * chore: roll Firefox to 150.0.3 (upstream #14983) by @kblok in hardkoded/puppeteer-sharp#3468 * chore: roll Chrome to 148.0.7778.167 (upstream #14980) by @kblok in hardkoded/puppeteer-sharp#3469 * feat(webmcp): add UntrustedContent annotation support by @kblok in hardkoded/puppeteer-sharp#3442 ## What's Changed * Update sponsors by @github-actions[bot] in hardkoded/puppeteer-sharp#3444 * fix: do not open DevTools if it is already open by @kblok in hardkoded/puppeteer-sharp#3443 * feat: implement URL allowlist for network restrictions (upstream #14897, #14931) by @kblok in hardkoded/puppeteer-sharp#3445 * fix: disable WebUIReloadButton experiment in Chrome launcher by @kblok in hardkoded/puppeteer-sharp#3438 * Fix #3448: correct CDP_ONLY condition check and missing using guards by @kblok in hardkoded/puppeteer-sharp#3449 * chore: sync WebMCP test expectations from upstream PR #14918 (#14918) by @kblok in hardkoded/puppeteer-sharp#3450 * Implement upstream PR #14821: browser extensions API by @kblok in hardkoded/puppeteer-sharp#3404 * remove networkidle from setContent by @kblok in hardkoded/puppeteer-sharp#3453 * fix: reject BiDi URL restrictions by @kblok in hardkoded/puppeteer-sharp#3452 * Implement upstream PR #14430 - dispose sub-classes correctly by @kblok in hardkoded/puppeteer-sharp#3454 * Implement upstream PR #14946 - Roll Firefox to 150.0.2 by @kblok in hardkoded/puppeteer-sharp#3451 * Implement upstream PR #14945 - optimize url blocking on navigation by @kblok in hardkoded/puppeteer-sharp#3455 * fix: normalize newline-separated headers to comma-separated (upstream #14492) by @kblok in hardkoded/puppeteer-sharp#3457 * fix: block emulateNetworkConditions when block/allowlist is active (upstream #14976) by @kblok in hardkoded/puppeteer-sharp#3458 * fix: don't store request on BrowsingContext (upstream #14966) by @kblok in hardkoded/puppeteer-sharp#3460 * fix!: remove Cookie SameParty attribute (upstream #14545) by @kblok in hardkoded/puppeteer-sharp#3461 * chore: track upstream #14910 (remove deprecated Browser.isConnected()) by @kblok in hardkoded/puppeteer-sharp#3464 * fix: route CDP responses by callback id when sessionId missing (upstream #14975) by @kblok in hardkoded/puppeteer-sharp#3456 * fix: enabled features take precedence over disabled features (upstream #14985) by @kblok in hardkoded/puppeteer-sharp#3470 * chore: bump version to 25.0.4 by @kblok in hardkoded/puppeteer-sharp#3471 **Full Changelog**: hardkoded/puppeteer-sharp@v24.42.0...v25.0.4 Commits viewable in [compare view](hardkoded/puppeteer-sharp@v24.42.0...v25.0.4). </details> [](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 this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sondre Sjølyst <18713420+sondresjolyst@users.noreply.github.com>
This was referenced Jun 12, 2026
This was referenced Jun 22, 2026
This was referenced Jul 3, 2026
This was referenced Jul 10, 2026
This was referenced Jul 20, 2026
This was referenced Aug 7, 2026
This was referenced Sep 11, 2026
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements changes from puppeteer/puppeteer#14821
Summary
Extensionabstract base class withId,Name,Version,WorkersAsync(),PagesAsync(),TriggerActionAsync()ExtensionsAsync(),InstallExtensionAsync(),UninstallExtensionAsync()toIBrowser/BrowserTriggerExtensionActionAsync(Extension)toIPage/PageCdpExtension,CdpBrowserextension managementNotSupportedExceptionExtensionsTestswith 8 tests matching upstreamcdp/extensions.specextension-with-pagetest asset🤖 Generated with Claude Code