Skip to content

fix: handle file:// URLs in navigate and close-tabs tools#305

Open
nklyshko wants to merge 1 commit intohangwin:masterfrom
nklyshko:fix/file-url-pattern-matching
Open

fix: handle file:// URLs in navigate and close-tabs tools#305
nklyshko wants to merge 1 commit intohangwin:masterfrom
nklyshko:fix/file-url-pattern-matching

Conversation

@nklyshko
Copy link

@nklyshko nklyshko commented Feb 23, 2026

chrome.tabs.query requires valid url match patterns (e.g. https://example.com/*). The pattern-building logic unconditionally extracted host + path-wildcard, but file:// URLs have no host — producing broken patterns like file:///home/* that never match any open tab.

For file:// URLs, use the exact URL as the query pattern instead, which Chrome supports and correctly identifies the specific local file.

chrome.tabs.query requires valid Chrome match patterns (e.g. https://example.com/*).
The pattern-building logic unconditionally extracted host + path-wildcard, but
file:// URLs have no host — producing broken patterns like file:///home/* that
never match any open tab.

For file:// URLs, use the exact URL as the query pattern instead, which Chrome
supports and correctly identifies the specific local file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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