tor-browser

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

sync.js (682B)


      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 const { triggerSync } = ChromeUtils.importESModule(
      6  "resource://gre/modules/services-automation/ServicesAutomation.sys.mjs"
      7 );
      8 
      9 // Arguments is expected to be provided in the scope that this file is loaded
     10 // into.
     11 /* global arguments */
     12 
     13 let resolve = arguments[3];
     14 try {
     15  triggerSync(arguments[0], arguments[1], arguments[2]).then(res => {
     16    resolve(res);
     17  });
     18 } catch (error) {
     19  let res = { logs: {}, result: 1, result_message: error.toString() };
     20  resolve(res);
     21 }