Skip to content

test(browser): document blocked popup compatibility gates - #30537

Merged
AmethystLiang merged 5 commits into
mainfrom
youtube-popup-adapter-prerequisite
Oct 19, 2026
Merged

AmethystLiang merged 5 commits into
mainfrom
youtube-popup-adapter-prerequisite

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​523 $\color{#cf222e}{\Huge{\mathbf{−}}}$​21 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​502
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​330 $\color{#cf222e}{\Huge{\mathbf{−}}}$​90 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​240

ELI5

An openerless popup can still inherit browser restrictions that disappear if it is reopened as an ordinary tab. Electron 43.7.8 does not expose enough synchronous information to distinguish the tested restricted and safe script popups, so this prerequisite remains BLOCKED and changes no production routing.

What Changed

Added hidden Electron probes for actual adopted/native script children, restricted iframe controls, native link flags, missing adopted link contents, same-session parents, creation order and an unrelated-window admission reproducer. Replaced the single-listener native app mock with EventEmitter delivery and five explicit expected-failure assertions for the desired no-theft contract, plus a duplicate control. Reused the existing compatibility harness and included the new probe in Node runtime and the existing Linux boundary job.

Why

A passing mock or a fresh callback closure cannot prove that Electron supplies the matching original child. Real probes show that the production native adapter can grant an admission to an unrelated same-session window, and that the restricted/escape script controls have indistinguishable synchronous metadata despite different browser-enforced behavior. Recording the API limits keeps routing changes behind the required gate until the API or presentation tradeoff is explicitly resolved.

Linked Issue

Internal prerequisite to the supplied YouTube reauthentication design. No new issue was opened; the separate WebContentsView architecture investigation is not this change's scope.

Visual Proof

N/A — production behavior and UI are unchanged. The hidden synthetic Electron run observed handler admission before child creation, navigation before onBeforeRequest, and popup policy attached before the matching child’s first request. It reproduced the native adapter granting a pending admission to an unrelated same-session window while the actual popup received no callback. Restricted and escape-enabled script children exposed identical synchronous handler metadata and preferences even though Chromium blocked form submission only in the restricted child.

Testing

  • I manually tested these changes locally through hidden synthetic Electron/CDP fixtures on macOS arm64.
  • Automated tests added/updated. Five named expected failures document unresolved admission contract violations; they are not passed release gates.

Validation: 94 passed and 5 expected contract failures (99 cases) across six files; 51 CI/runtime-routing checks passed; Node typecheck and changed-file code quality passed. Native focus/visible windows, Linux/Windows runtime, SSH/server-hosted authentication, replacement-tab materialization, stress comparison and a fresh YouTube challenge remain unverified.

Review

Do not treat this draft as approval to broaden popup routing. Adopted association, native association, adopted script conversion safety and native script conversion safety are each BLOCKED. No production admission workaround is included.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

The four admission/conversion gates remain blocked. The original YouTube routing defect is still present; implementing that repair requires resolving the API or presentation decision described in the evidence report. Fixtures use synthetic local destinations and cookies; no saved authentication callbacks were used.

Checklist

  • This PR is small and focused on compatibility evidence and faithful mocks.
  • I explained what changed and why (ELI5, user behavior, mechanism and alternatives).
  • N/A with reason provided for production visual changes.
  • Self-reviewed for correctness, security and performance.
  • Cross-platform, SSH/remote and path/shortcut impact considered; actual untested environments are listed.
  • Full repository lint/typecheck/test/build and remote CI were not all run; focused checks and their exact results are recorded in the evidence report.

@AmethystLiang
AmethystLiang marked this pull request as ready for review October 19, 2026 05:13
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3b74e01-b6e6-4365-898b-e1ee2ac4eff7
📥 Commits

Reviewing files that changed from the base of the PR and between 6328a10 and b51a223.

📒 Files selected for processing: 14
  • .github/workflows/pr.yml
  • config/scripts/ci-unit-files.mjs
  • config/scripts/pr-package-test-paths.mjs
  • config/scripts/vitest-node-runtime-files.mjs
  • docs/bug-reproductions/youtube-reauth/popup-adapter-electron-43.7.8-trace.json
  • docs/bug-reproductions/youtube-reauth/popup-adapter-prerequisite-evidence.md
  • docs/bug-reproductions/youtube-reauth/popup-adapter-prerequisite-pr.md
  • src/main/browser/browser-popup-adapter-compatibility.electron.test.ts
  • src/main/browser/browser-popup-adapter-probe-fixture.ts
  • src/main/browser/browser-popup-compatibility-cdp-fixture.ts
  • src/main/browser/browser-popup-compatibility-electron-fixture.ts
  • src/main/browser/browser-popup-compatibility-manager-fixture.ts
  • src/main/browser/browser-popup-compatibility-status.ts
  • src/main/browser/browser-popup-native-window.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change adds Electron fixtures and tests that observe popup creation, navigation, request association, and sandbox behavior across adopted and native creation paths. It adds CI routing for the new test and records investigation results, including known association failures. The supplied documentation states that production routing and persistence schemas remain unchanged.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b51a2

This PR adds popup compatibility probes, tests and documentation without changing production behavior. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 10 files. (3 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly identifies the browser test scope and the purpose of documenting blocked popup compatibility gates.
Description check Passed The description is complete and aligned with the template. It explains the user impact, changes, rationale, testing, limitations, and review risks. It does not provide an issue link, but it documents …
Full details: Description check

Explanation

The description is complete and aligned with the template. It explains the user impact, changes, rationale, testing, limitations, and review risks. It does not provide an issue link, but it documents the internal prerequisite and otherwise contains the required information.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 10 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang merged commit d2bb607 into main Oct 19, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant