Open Bug 1763911 Opened 3 years ago Updated 3 years ago

Improve error message when adoptTab fails during browser.tabs.move

Categories

(WebExtensions :: Frontend, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: Oriol, Unassigned)

References

(Blocks 1 open bug)

Details

See detailed STR in bug 1762800 comment 0.

Using browser.tabs.move to move tabs between windows relies on gBrowser.adoptTab, which sometimes fails (e.g. bug 1758307).

Then gBrowser.adoptTab returns null, but https://searchfox.org/mozilla-central/rev/78c8fd2e91ca0f4f85ed11fa2a19564f50e75b34/browser/components/extensions/parent/ext-tabs.js#1138,1143 doesn't expect this

nativeTab = gBrowser.adoptTab(nativeTab, insertionPoint, false);
// That's null! Later:
lastInsertion.set(window, nativeTab._tPos);
// nativeTab._tPos throws

Then the promise is rejected with Error: An unexpected error occurred. I think a more meaningful message could be provided, like Error: Failed to move tab with ID: 239.

Severity: -- → N/A
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.