(tabs, { to, recursively } = {})
| 452 | } |
| 453 | |
| 454 | export function sendTabsToDevice(tabs, { to, recursively } = {}) { |
| 455 | if (recursively) |
| 456 | tabs = Tab.collectRootTabs(tabs).map(tab => [tab, ...tab.$TST.descendants]).flat(); |
| 457 | tabs = tabs.filter(isSendableTab); |
| 458 | |
| 459 | if (mExternalProvider) |
| 460 | return mExternalProvider.sendTabsToDevice(tabs, to); |
| 461 | |
| 462 | sendMessage(to, getTabsDataToSend(tabs)); |
| 463 | |
| 464 | const multiple = tabs.length > 1 ? '_multiple' : ''; |
| 465 | notify({ |
| 466 | title: browser.i18n.getMessage( |
| 467 | `sentTabs_notification_title${multiple}`, |
| 468 | [getDeviceName(to)] |
| 469 | ), |
| 470 | message: browser.i18n.getMessage( |
| 471 | `sentTabs_notification_message${multiple}`, |
| 472 | [getDeviceName(to)] |
| 473 | ), |
| 474 | timeout: configs.syncSentTabsNotificationTimeout |
| 475 | }); |
| 476 | } |
| 477 | |
| 478 | export async function sendTabsToAllDevices(tabs, { recursively } = {}) { |
| 479 | if (recursively) |
nothing calls this directly
no test coverage detected