tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

placesContextMenu.js (1359B)


      1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 document.addEventListener(
      7  "DOMContentLoaded",
      8  () => {
      9    const placesContext = document.getElementById("placesContext");
     10 
     11    placesContext.addEventListener("popupshowing", event =>
     12      PlacesUIUtils.placesContextShowing(event)
     13    );
     14    placesContext.addEventListener("popuphiding", event =>
     15      PlacesUIUtils.placesContextHiding(event)
     16    );
     17 
     18    placesContext.addEventListener("command", event => {
     19      switch (event.target.id) {
     20        case "placesContext_openBookmarkContainer:tabs":
     21        case "placesContext_openBookmarkLinks:tabs":
     22        case "placesContext_openContainer:tabs":
     23        case "placesContext_openLinks:tabs":
     24          PlacesUIUtils.openSelectionInTabs(event);
     25          break;
     26      }
     27    });
     28 
     29    const containerPopup = document.getElementById(
     30      "placesContext_open_newcontainertab_popup"
     31    );
     32    containerPopup.addEventListener("command", event =>
     33      PlacesUIUtils.openInContainerTab(event)
     34    );
     35    containerPopup.addEventListener("popupshowing", event =>
     36      PlacesUIUtils.createContainerTabMenu(event)
     37    );
     38  },
     39  { once: true }
     40 );