summaryrefslogtreecommitdiff
path: root/components/customizableui/CustomizableWidgets.jsm
diff options
context:
space:
mode:
Diffstat (limited to 'components/customizableui/CustomizableWidgets.jsm')
-rw-r--r--components/customizableui/CustomizableWidgets.jsm34
1 files changed, 0 insertions, 34 deletions
diff --git a/components/customizableui/CustomizableWidgets.jsm b/components/customizableui/CustomizableWidgets.jsm
index 3e00d38..5ee8634 100644
--- a/components/customizableui/CustomizableWidgets.jsm
+++ b/components/customizableui/CustomizableWidgets.jsm
@@ -314,40 +314,6 @@ const CustomizableWidgets = [
obnode.setAttribute("element", "sync-status");
obnode.setAttribute("attribute", "syncstatus");
aNode.appendChild(obnode);
-
- // A somewhat complicated dance to format the mobilepromo label.
- let bundle = doc.getElementById("bundle_browser");
- let formatArgs = ["android", "ios"].map(os => {
- let link = doc.createElement("label");
- link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`);
- link.setAttribute("mobile-promo-os", os);
- link.className = "text-link remotetabs-promo-link";
- return link.outerHTML;
- });
- let promoParentElt = doc.getElementById("PanelUI-remotetabs-mobile-promo");
- // Put it all together...
- let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs);
- promoParentElt.innerHTML = contents;
- // We manually manage the "click" event to open the promo links because
- // allowing the "text-link" widget handle it has 2 problems: (1) it only
- // supports button 0 and (2) it's tricky to intercept when it does the
- // open and auto-close the panel. (1) can probably be fixed, but (2) is
- // trickier without hard-coding here the knowledge of exactly what buttons
- // it does support.
- // So we allow left and middle clicks to open the link in a new tab and
- // close the panel; not setting a "href" attribute prevents the text-link
- // widget handling it, and we build the final URL in the click handler to
- // make testing easier (ie, so tests can change the pref after the links
- // were created and have the new pref value used.)
- promoParentElt.addEventListener("click", e => {
- let os = e.target.getAttribute("mobile-promo-os");
- if (!os || e.button > 1) {
- return;
- }
- let link = Services.prefs.getCharPref(`identity.mobilepromo.${os}`) + "synced-tabs";
- doc.defaultView.openUILinkIn(link, "tab");
- CustomizableUI.hidePanelForNode(e.target);
- });
},
onViewShowing(aEvent) {
let doc = aEvent.target.ownerDocument;