Skip to content

Detect pending tab navigations for popup domain suggestions - #544

Merged
salarcode merged 7 commits into
masterfrom
copilot/enhancement-detect-url-changes
Aug 17, 2026
Merged

Detect pending tab navigations for popup domain suggestions#544
salarcode merged 7 commits into
masterfrom
copilot/enhancement-detect-url-changes

Conversation

Copilot AI commented May 19, 2026

Copy link
Copy Markdown
Contributor

Popup domain suggestions previously depended on tabs.onUpdated, so they could lag while a page was still loading. This change tracks main-frame navigation earlier via webNavigation, while falling back to the current document URL if navigation is cancelled.

  • Navigation tracking

    • Subscribe to webNavigation main-frame events in TabManager.
    • Update tracked tab URL on navigation start/commit/history/fragment updates.
    • Reload tab data on navigation errors when the pending URL did not commit.
  • Extension permissions

    • Add webNavigation permission across supported manifests.
  • Test coverage

    • Add focused TabManager tests for:
      • pending main-frame URL updates
      • ignoring sub-frame navigations
      • reverting to current document URL after navigation failure
api.webNavigation.onBeforeNavigate.addListener(TabManager.handleNavigationStarted);
api.webNavigation.onCommitted.addListener(TabManager.handleNavigationCommitted);
api.webNavigation.onErrorOccurred.addListener(TabManager.handleNavigationError);

Copilot AI and others added 3 commits May 19, 2026 12:03
Agent-Logs-Url: https://github.com/salarcode/SmartProxy/sessions/ce813f92-b526-45e7-b41c-0b2152e4e5a2

Co-authored-by: salarcode <1272095+salarcode@users.noreply.github.com>
Agent-Logs-Url: https://github.com/salarcode/SmartProxy/sessions/ce813f92-b526-45e7-b41c-0b2152e4e5a2

Co-authored-by: salarcode <1272095+salarcode@users.noreply.github.com>
Agent-Logs-Url: https://github.com/salarcode/SmartProxy/sessions/ce813f92-b526-45e7-b41c-0b2152e4e5a2

Co-authored-by: salarcode <1272095+salarcode@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance popup menu for domain suggestion during navigation Detect pending tab navigations for popup domain suggestions May 19, 2026
Copilot AI requested a review from salarcode May 19, 2026 12:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Tracks pending main-frame navigations so popup domain suggestions reflect destinations before page loading completes.

Changes:

  • Adds webNavigation tracking and URL reconciliation.
  • Adds navigation permissions to browser manifests.
  • Adds focused utility and tab-navigation tests.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/core/TabManager.ts Tracks navigation events and updates tab URLs.
src/lib/Utils.ts Adds transient and pending URL logic.
src/tests/TabManager.test.ts Tests navigation tracking behavior.
src/tests/Utils.test.ts Tests URL preservation helpers.
package.json Configures Jest for TypeScript tests.
src/manifest-chrome.json Adds navigation permission.
src/manifest-chrome-mv2.json Adds navigation permission.
src/manifest-edge.json Adds navigation permission.
src/manifest-firefox.json Adds navigation permission.
src/manifest-firefox-unlisted.json Adds navigation permission.
src/manifest-firefox-android.json Adds navigation permission.
src/manifest-opera.json Adds navigation permission.
src/manifest-thunderbird.json Adds navigation permission.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/Utils.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/lib/Utils.ts:303

  • This predicate still allows a lagging real tabs.query URL to overwrite the pending URL. updateActiveTab runs on every tabs.onUpdated; after onBeforeNavigate stores https://new.example, a query still reporting the previous https://old.example makes this return false, restoring the old URL and reintroducing the popup lag. URL shape cannot distinguish a pending navigation from error recovery (and also prevents recovery to a legitimate about:blank); track explicit pending-navigation state and clear/override it on commit or error instead.
		return Utils.isTransientTabUrl(incomingUrl) && !Utils.isTransientTabUrl(existingUrl);

@salarcode
salarcode marked this pull request as ready for review August 17, 2026 12:42
@salarcode salarcode closed this Aug 17, 2026
@salarcode
salarcode deleted the copilot/enhancement-detect-url-changes branch August 17, 2026 12:43
@salarcode
salarcode restored the copilot/enhancement-detect-url-changes branch August 17, 2026 12:43
@salarcode salarcode reopened this Aug 17, 2026
@salarcode
salarcode merged commit c226256 into master Aug 17, 2026
1 check passed
@salarcode
salarcode deleted the copilot/enhancement-detect-url-changes branch August 17, 2026 12:43
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.

[enhancement] Detect url changes to enable domain suggestion on popup menu before tab loading is completed

3 participants