MCPcopy
hub / github.com/piroor/treestyletab / sendTabsToDevice

Function sendTabsToDevice

webextensions/common/sync.js:454–476  ·  view source on GitHub ↗
(tabs, { to, recursively } = {})

Source from the content-addressed store, hash-verified

452}
453
454export 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
478export async function sendTabsToAllDevices(tabs, { recursively } = {}) {
479 if (recursively)

Callers

nothing calls this directly

Calls 5

notifyFunction · 0.90
getTabsDataToSendFunction · 0.85
getDeviceNameFunction · 0.85
collectRootTabsMethod · 0.80
sendMessageFunction · 0.70

Tested by

no test coverage detected