tor-browser

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

error-messages.js (835B)


      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 "use strict";
      6 
      7 // eslint-disable-next-line mozilla/reject-some-requires
      8 loader.lazyRequireGetter(
      9  this,
     10  "getAdHocFrontOrPrimitiveGrip",
     11  "resource://devtools/client/fronts/object.js",
     12  true
     13 );
     14 
     15 module.exports = function ({ resource, targetFront }) {
     16  if (resource?.pageError?.errorMessage) {
     17    resource.pageError.errorMessage = getAdHocFrontOrPrimitiveGrip(
     18      resource.pageError.errorMessage,
     19      targetFront
     20    );
     21  }
     22 
     23  if (resource?.pageError?.exception) {
     24    resource.pageError.exception = getAdHocFrontOrPrimitiveGrip(
     25      resource.pageError.exception,
     26      targetFront
     27    );
     28  }
     29 
     30  return resource;
     31 };