Skip to content

A same-document URL change (hash, pushState) removes the in-page player and re-arms the allowlist's mpv hand-off #236

Closed

Description

@Nawid3333

Severity: low

Where: chrome/background/background.mjs (tabs.onUpdated: if (changeInfo.url) { ... tab.mpvAutoOpened = false; tab.mpvSentUrls.clear(); ... chrome.tabs.sendMessage(tabid, {type: REMOVE_PLAYERS}, {frameId: 0}, ...))

What happens

Firefox fires tabs.onUpdated with url for location.hash changes and history.pushState too. The comment says the latch is "per page", but in allowlist mode the reset runs for any URL change while nothing reloaded. Allowlisted site, stream handed to mpv, mpvPausePage off (or the page resumes): the page sets #comments or updates ?t= while its player keeps running; the next new stream URL it requests (a variant playlist after a quality switch, the next .mp4 segment) hits !frame.tab.mpvAutoOpened and opens a second mpv window. With the in-page player: a hash change tears the FastStream overlay down.

Suggested fix

Ignore changes where only the fragment differs (compare changeInfo.url and tab.url with the hash stripped), or move the per-page latch reset to FRAME_ADDED of frame 0 (a real new document; TabHolder.noteDocumentReplaced already fires there).

Confidence: medium (depends on site behaviour; no e2e covers an allowlist page that changes its URL without loading).


From a line-by-line code review of the tree at 41363fd (2026-10-02). Each claim above was checked against the source before filing; the reproduction steps and line references are as of that commit.


Generated by Claude Code

Activity

  1. added
    bugSomething isn't working
    code-reviewFound by the 2026-10-02 line-by-line review
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcode-reviewFound by the 2026-10-02 line-by-line review

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions