Chromium engine: chrome.tabs.query({active, currentWindow}) from an action popup returns no tab, so tabCapture extensions (川流字幕 Subruu) can't start

Open
#927 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript, macos, swift
Domain
api

Research direction

Start by tracing Chromium extension tab handling around chrome.tabs.query({active:true, currentWindow:true}), then compare with the embedder-owned tab patches 0026, 0119 and 0136 mentioned in the issue. The report does not identify the relevant source files or a Chromium end-to-end test, so first locate the query implementation and existing extension tests. Done means the popup receives the active YouTube tab and the extension can proceed to its capture startup flow.

Written by the indexing model from the issue text.

Description

area: web Broken bug engine: chromium

Environment

  • Yab 0.48.0 (build 202611161400), macOS, Chromium engine, Personal space (shared sign-in)
  • Extension: 川流字幕 Subruu, fdhjjimjclphneajgcajolflaodiblkp, v0.1.777.41 (Chrome Web Store). MV3; permissions include tabs, activeTab, tabCapture, offscreen, scripting (all granted, no disable reasons).

Steps

  1. Install the extension from the Chrome Web Store and sign in. Sign-in works.
  2. Open a youtube.com/watch video and click the extension's toolbar button. The popup opens.
  3. Press start.

Reproduces both in a pinned tab shared across spaces and in a normal new tab (⌘T, paste URL, play video).

Expected
Captions start, as in Chrome.

Actual
The start fails within ~150 ms with 請重新開啟插件並確認目前影片。 ("please reopen the extension and confirm the current video"), recorded by the extension's own startup diagnostics at popup.js:1:35733. That error is only thrown when the popup has no target tab URL. The popup gets its target from chrome.tabs.query({active:true, currentWindow:true}), so in Yab that call returned no tab, or a tab without a url. The request never reaches the service worker and tabCapture.getMediaStreamId is never called.

In 0.47.10 the same flow instead stalled in the service worker after the popup handed off and before capture began (diagnostics stuck at step begin, never reaching start-enter). Between those steps the worker only calls chrome.tabs.get(tabId), chrome.permissions.contains({origins:["https://www.youtube.com/*"]}), chrome.storage.local.set and chrome.tabs.sendMessage (700 ms timeout). Both versions point at extension tab lookups for the popup's page.

Notes

  • Possibly related: patches 0026, 0119 and 0136 (embedder-owned windows and tabs, concealed producers, embedded tab operations). I couldn't find a Chromium-side end-to-end test for tabCapture / offscreen, only WebKit ones.
  • I couldn't collect console output: the popup has no right-click Inspect, chrome://extensions and chrome-extension:// pages can't be opened, and there's no way to enable remote debugging on the installed app (YAB_HELPER_ARGS is only read when Store.testing). A supported way to inspect an extension's popup / service worker would help debug issues like this.
Dominant language
Swift
Stars
648
Forks
56
Avg merge
21h 14m
Merged PRs (30d)
22

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yetanotherbrowser/yab

All issues in yetanotherbrowser/yab

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.