179 lines
7.8 KiB
Diff
179 lines
7.8 KiB
Diff
--- a/browser/base/content/browser-context.inc
|
|
+++ b/browser/base/content/browser-context.inc
|
|
@@ -279,14 +279,6 @@
|
|
label="&savePageCmd.label;"
|
|
accesskey="&savePageCmd.accesskey2;"
|
|
oncommand="gContextMenu.savePageAs();"/>
|
|
- <menuseparator id="context-sep-sendpagetodevice" hidden="true"/>
|
|
- <menu id="context-sendpagetodevice"
|
|
- label="&sendPageToDevice.label;"
|
|
- accesskey="&sendPageToDevice.accesskey;"
|
|
- hidden="true">
|
|
- <menupopup id="context-sendpagetodevice-popup"
|
|
- onpopupshowing="(() => { let browser = gBrowser || getPanelBrowser(); gFxAccounts.populateSendTabToDevicesMenu(event.target, browser.currentURI.spec, browser.contentTitle); })()"/>
|
|
- </menu>
|
|
<menuseparator id="context-sep-viewbgimage"/>
|
|
<menuitem id="context-viewbgimage"
|
|
label="&viewBGImageCmd.label;"
|
|
@@ -326,14 +318,6 @@
|
|
oncommand="AddKeywordForSearchField();"/>
|
|
<menuitem id="context-searchselect"
|
|
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms);"/>
|
|
- <menuseparator id="context-sep-sendlinktodevice" hidden="true"/>
|
|
- <menu id="context-sendlinktodevice"
|
|
- label="&sendLinkToDevice.label;"
|
|
- accesskey="&sendLinkToDevice.accesskey;"
|
|
- hidden="true">
|
|
- <menupopup id="context-sendlinktodevice-popup"
|
|
- onpopupshowing="gFxAccounts.populateSendTabToDevicesMenu(event.target, gContextMenu.linkURL, gContextMenu.linkTextStr);"/>
|
|
- </menu>
|
|
<menuitem id="context-shareselect"
|
|
label="&shareSelect.label;"
|
|
accesskey="&shareSelect.accesskey;"
|
|
--- a/browser/base/content/browser-fxaccounts.js
|
|
+++ b/browser/base/content/browser-fxaccounts.js
|
|
@@ -371,81 +371,13 @@ var gFxAccounts = {
|
|
},
|
|
|
|
sendTabToDevice: function (url, clientId, title) {
|
|
- Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title);
|
|
},
|
|
|
|
populateSendTabToDevicesMenu: function (devicesPopup, url, title) {
|
|
- // remove existing menu items
|
|
- while (devicesPopup.hasChildNodes()) {
|
|
- devicesPopup.removeChild(devicesPopup.firstChild);
|
|
- }
|
|
-
|
|
- const fragment = document.createDocumentFragment();
|
|
-
|
|
- const onTargetDeviceCommand = (event) => {
|
|
- const clientId = event.target.getAttribute("clientId");
|
|
- const clients = clientId
|
|
- ? [clientId]
|
|
- : this.remoteClients.map(client => client.id);
|
|
-
|
|
- clients.forEach(clientId => this.sendTabToDevice(url, clientId, title));
|
|
- }
|
|
-
|
|
- function addTargetDevice(clientId, name) {
|
|
- const targetDevice = document.createElement("menuitem");
|
|
- targetDevice.addEventListener("command", onTargetDeviceCommand, true);
|
|
- targetDevice.setAttribute("class", "sendtab-target");
|
|
- targetDevice.setAttribute("clientId", clientId);
|
|
- targetDevice.setAttribute("label", name);
|
|
- fragment.appendChild(targetDevice);
|
|
- }
|
|
-
|
|
- const clients = this.remoteClients;
|
|
- for (let client of clients) {
|
|
- addTargetDevice(client.id, client.name);
|
|
- }
|
|
-
|
|
- // "All devices" menu item
|
|
- if (clients.length > 1) {
|
|
- const separator = document.createElement("menuseparator");
|
|
- fragment.appendChild(separator);
|
|
- const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem");
|
|
- addTargetDevice("", allDevicesLabel);
|
|
- }
|
|
-
|
|
- devicesPopup.appendChild(fragment);
|
|
},
|
|
|
|
updateTabContextMenu: function (aPopupMenu) {
|
|
- if (!this.sendTabToDeviceEnabled) {
|
|
- return;
|
|
- }
|
|
-
|
|
- const remoteClientPresent = this.remoteClients.length > 0;
|
|
- ["context_sendTabToDevice", "context_sendTabToDevice_separator"]
|
|
- .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent });
|
|
},
|
|
-
|
|
- initPageContextMenu: function (contextMenu) {
|
|
- if (!this.sendTabToDeviceEnabled) {
|
|
- return;
|
|
- }
|
|
-
|
|
- const remoteClientPresent = this.remoteClients.length > 0;
|
|
- // showSendLink and showSendPage are mutually exclusive
|
|
- const showSendLink = remoteClientPresent
|
|
- && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink);
|
|
- const showSendPage = !showSendLink && remoteClientPresent
|
|
- && !(contextMenu.isContentSelected ||
|
|
- contextMenu.onImage || contextMenu.onCanvas ||
|
|
- contextMenu.onVideo || contextMenu.onAudio ||
|
|
- contextMenu.onLink || contextMenu.onTextInput);
|
|
-
|
|
- ["context-sendpagetodevice", "context-sep-sendpagetodevice"]
|
|
- .forEach(id => contextMenu.showItem(id, showSendPage));
|
|
- ["context-sendlinktodevice", "context-sep-sendlinktodevice"]
|
|
- .forEach(id => contextMenu.showItem(id, showSendLink));
|
|
- }
|
|
};
|
|
|
|
XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () {
|
|
--- a/browser/base/content/browser.xul
|
|
+++ b/browser/base/content/browser.xul
|
|
@@ -104,13 +104,6 @@
|
|
hidden="true"
|
|
oncommand="gBrowser.openNonRemoteWindow(TabContextMenu.contextTab);"/>
|
|
#endif
|
|
- <menuseparator id="context_sendTabToDevice_separator" hidden="true"/>
|
|
- <menu id="context_sendTabToDevice" label="&sendTabToDevice.label;"
|
|
- accesskey="&sendTabToDevice.accesskey;" hidden="true">
|
|
- <menupopup id="context_sendTabToDevicePopupMenu"
|
|
- onpopupshowing="gFxAccounts.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle);"/>
|
|
- </menu>
|
|
- <menuseparator/>
|
|
<menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
|
|
tbattr="tabbrowser-multiple-visible"
|
|
oncommand="gBrowser.reloadAllTabs();"/>
|
|
--- a/browser/components/sessionstore/SessionStore.jsm
|
|
+++ b/browser/components/sessionstore/SessionStore.jsm
|
|
@@ -894,7 +894,6 @@ var SessionStoreInternal = {
|
|
SessionStoreInternal._resetLocalTabRestoringState(tab);
|
|
SessionStoreInternal.restoreNextTab();
|
|
|
|
- this._sendTabRestoredNotification(tab, data.isRemotenessUpdate);
|
|
break;
|
|
case "SessionStore:crashedTabRevived":
|
|
// The browser was revived by navigating to a different page
|
|
@@ -4272,22 +4271,6 @@ var SessionStoreInternal = {
|
|
aWindow.dispatchEvent(event);
|
|
},
|
|
|
|
- /**
|
|
- * Dispatch the SSTabRestored event for the given tab.
|
|
- * @param aTab
|
|
- * The tab which has been restored
|
|
- * @param aIsRemotenessUpdate
|
|
- * True if this tab was restored due to flip from running from
|
|
- * out-of-main-process to in-main-process or vice-versa.
|
|
- */
|
|
- _sendTabRestoredNotification(aTab, aIsRemotenessUpdate) {
|
|
- let event = aTab.ownerDocument.createEvent("CustomEvent");
|
|
- event.initCustomEvent("SSTabRestored", true, false, {
|
|
- isRemotenessUpdate: aIsRemotenessUpdate,
|
|
- });
|
|
- aTab.dispatchEvent(event);
|
|
- },
|
|
-
|
|
/**
|
|
* @param aWindow
|
|
* Window reference
|
|
--- a/browser/locales/en-US/chrome/browser/accounts.properties
|
|
+++ b/browser/locales/en-US/chrome/browser/accounts.properties
|
|
@@ -35,10 +35,6 @@ syncStartNotification.body2 = %S will begin syncing momentarily.
|
|
deviceDisconnectedNotification.title = Sync disconnected
|
|
deviceDisconnectedNotification.body = This computer has been successfully disconnected from Firefox Sync.
|
|
|
|
-# LOCALIZATION NOTE (sendTabToAllDevices.menuitem)
|
|
-# Displayed in the Send Tabs context menu when right clicking a tab, a page or a link.
|
|
-sendTabToAllDevices.menuitem = All Devices
|
|
-
|
|
# LOCALIZATION NOTE (tabArrivingNotification.title, tabArrivingNotificationWithDevice.title,
|
|
# tabsArrivingNotification.title, unnamedTabsArrivingNotification2.body,
|
|
# unnamedTabsArrivingNotificationMultiple2.body, unnamedTabsArrivingNotificationNoDevice.body)
|