Open Bug 1394373 Opened 7 years ago Updated 2 years ago

Add option to duplicate tabs into different window for browser.tabs.duplicate()

Categories

(WebExtensions :: General, enhancement, P5)

enhancement

Tracking

(Not tracked)

People

(Reporter: yuki, Unassigned)

Details

(Whiteboard: [design-decision-approved])

To duplicate tabs into different (new) window, we need to do these steps: 1. Open new blank window. 2. Duplicate tabs in the old window. 3. Move duplicated tabs to new window. because browser.tabs.duplicate() doesn't provide ability to do them at a time. https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/tabs/duplicate https://developer.chrome.com/extensions/tabs#method-duplicate However, the promise returned by browser.tabs.duplicate() is resolved after all duplicated tabs are completely loaded, thus we have to wait for minutes between the step 2 and 3. It is painful and dangerous, because the user can close the blank window before all duplicated tabs are ready. So I propose a new option to duplicate given tabs into different window, like: var duplicatedTabs = await browser.tabs.duplicate([1, 2, 3], { windowId: 5 }) How about this?
This is reequired by Tree Style Tab to implement its feature: duplicate a tree as a separate window. https://github.com/piroor/treestyletab/tree/master/webextensions
Whiteboard: [design-decision-needed]
Severity: normal → enhancement
Priority: -- → P5
Hi Piro, this has been added to the agenda for the September 26 WebExtensions APIs triage meeting. Would you be able to join us on IRC? Wiki: https://docs.google.com/document/d/1pw5y-GHwDLPV9bYK4HWCiZtslqFtAeL3G9bC4ZDbdjs/edit# Agenda: https://docs.google.com/document/d/1pw5y-GHwDLPV9bYK4HWCiZtslqFtAeL3G9bC4ZDbdjs/edit#
OK, I'll join to IRC. By the way, another similar bug 1394376 ls already triaged as wontfix on Fx57. I need one of them on Fx57, for painless migration...
Just to be clear on timelines, neither of those bugs will be happening in time for 57.
Whiteboard: [design-decision-needed] → [design-decision-approved]
Product: Toolkit → WebExtensions
Component: Untriaged → General
Severity: normal → S3

I’m interested in fixing this but I’m not quite sure where to fiddle in browser/components/extensions/parent/ext-tabs.js and browser/components/sessionstore/SessionStore.sys.mjs. Where and what should I do to duplicate (“restore”) the tab in a new window?

You need to log in before you can comment on or make changes to this bug.