tor-browser

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

start_desktop.js (820B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 // Defined by Marionette.
      6 /* global __webDriverArguments */
      7 const flavor = __webDriverArguments[0].flavor;
      8 const url = __webDriverArguments[0].testUrl;
      9 
     10 // eslint-disable-next-line mozilla/use-services
     11 let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(
     12  Ci.nsIWindowMediator
     13 );
     14 let win = wm.getMostRecentWindow("navigator:browser");
     15 if (!win) {
     16  win = wm.getMostRecentWindow("mail:3pane");
     17 }
     18 
     19 // testing/mochitest/api.js has set up a listener for this event, to discover
     20 // the flavor and url to load.
     21 let ev = new CustomEvent("mochitest-load", { detail: [flavor, url] });
     22 win.dispatchEvent(ev);