Skip to content

fix: detect same-URL navigations via webNavigation.onCommitted for st…#501

Merged
henyaGreenberg merged 1 commit into
mainfrom
webNavigation
May 24, 2026
Merged

fix: detect same-URL navigations via webNavigation.onCommitted for st…#501
henyaGreenberg merged 1 commit into
mainfrom
webNavigation

Conversation

@henyaGreenberg

Copy link
Copy Markdown
Contributor

AB: “The ‘Activated’ popup doesn’t appear after activation on StubHub.com.”
https://github.com/Bring-Web3-LTD/TODO/issues/355

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds same-URL navigation detection in the background script to ensure activation/injection logic runs even when tabs.onUpdated doesn’t emit a changeInfo.url update (e.g., affiliate activation flows that redirect back to the same retailer URL, like StubHub).

Changes:

  • Add chrome.webNavigation.onCommitted listener (top-frame) and per-tab URL deduping to catch same-URL navigations.
  • Refactor “page complete” inline-search scraping into a shared helper.
  • Update manifest/docs to include the webNavigation permission (documented as optional/recommended).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
extension-files/test-extension/public/manifest.json Adds webNavigation permission to enable onCommitted-based navigation detection.
extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Adds webNavigation.onCommitted handling + dedup map; refactors inline-search link scraping into onPageComplete.
extension-files/bringweb3-sdk/README.md Documents webNavigation permission and explains why it’s recommended.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated

@kalfada kalfada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please see the comments I added, also, every change in the SDK folder requires a changeset comment, lmk if you need help with that

Comment thread extension-files/bringweb3-sdk/README.md Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts
@henyaGreenberg henyaGreenberg force-pushed the webNavigation branch 3 times, most recently from f78272e to 78496e3 Compare May 17, 2026 07:15
@kalfada kalfada self-requested a review May 17, 2026 11:18
Comment thread extension-files/bringweb3-sdk/.changeset/web-navigation-support.md
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
Comment thread extension-files/bringweb3-sdk/utils/background/handleTabEvents.ts Outdated
- Add optional webNavigation.onCommitted listener to detect same-URL navigations
- Add webNavigation.onCompleted for inline-search page scraping
- Fall back to chrome.tabs.onUpdated when webNavigation permission is absent
- Add 'webNavigation' to test-extension manifest permissions
- Update README to document the optional webNavigation permission

@kalfada kalfada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@NoamMK NoamMK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@henyaGreenberg henyaGreenberg merged commit d1013a9 into main May 24, 2026
1 check 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.

4 participants