Skip to content

Fix/edge newtab background on user navigation#27

Open
s-maheshbabu wants to merge 2 commits into
monque:masterfrom
s-maheshbabu:fix/edge-newtab-background-on-user-navigation
Open

Fix/edge newtab background on user navigation#27
s-maheshbabu wants to merge 2 commits into
monque:masterfrom
s-maheshbabu:fix/edge-newtab-background-on-user-navigation

Conversation

@s-maheshbabu

Copy link
Copy Markdown

Problem:

This is a fix to make this extension work in Microsoft Edge. I understand this is a ChromeExtension but Edge officially supports the ability to run Chrome extensions inside Edge. The fix has been tested on both Edge and Chrome.

In Microsoft Edge, when a user has custom rules configured (e.g. edge://*), the extension uses a "pendingIds" mechanism to defer background-forcing for tabs created without a URL.

The side effect: pressing CMD+T (or the new tab button) creates a blank tab with no URL, which ends up in pendingIds. When the user then types a URL in the address bar and hits Enter, the extension treats that navigation the same as a link click and forces the tab to background — switching the user back to the previous tab against their intent.

Fix:
Replace the tabs.onUpdated pendingIds handler with a webNavigation.onCommitted listener. The webNavigation API exposes transitionType on every navigation:

  • "link" → user clicked a link (should background)
  • "typed" / "generated" / etc. → user typed in the address bar (skip)

Edge's internal edge://newtab/ page does not fire webNavigation events, so a CMD+T tab stays in pendingIds until the user navigates to an http/https URL. At that point transitionType is "typed", not "link", so handleTabCreate is skipped and the tab correctly remains in the foreground.

Adds the "webNavigation" permission to manifest.json.

s-maheshbabu and others added 2 commits May 9, 2026 00:06
Problem:
In Microsoft Edge, when a user has custom rules configured (e.g. edge://*),
the extension uses a "pendingIds" mechanism to defer background-forcing for
tabs created without a URL. This is needed because Edge sometimes creates
a blank tab before loading the link target, unlike Chrome which sets
pendingUrl on the tab immediately.

The side effect: pressing CMD+T (or the new tab button) also creates a
blank tab with no URL, which ends up in pendingIds. When the user then
types a URL in the address bar and hits Enter, the extension treats that
navigation the same as a link click and forces the tab to background —
switching the user back to the previous tab against their intent.

Fix:
Replace the tabs.onUpdated pendingIds handler with a
webNavigation.onCommitted listener. The webNavigation API exposes
transitionType on every navigation:
  - "link"      → user clicked a link (should background)
  - "typed" / "generated" / etc. → user typed in the address bar (skip)

Edge's internal edge://newtab/ page does not fire webNavigation events,
so a CMD+T tab stays in pendingIds until the user navigates to an http/https
URL. At that point transitionType is "typed", not "link", so handleTabCreate
is skipped and the tab correctly remains in the foreground.

Adds the "webNavigation" permission to manifest.json.

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