index.js (991B)
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 try { 8 const { BrowserLoader } = ChromeUtils.importESModule( 9 "resource://devtools/shared/loader/browser-loader.sys.mjs" 10 ); 11 // Expose both `browserLoader` and `Debugger` to panel.js 12 globalThis.browserLoader = BrowserLoader({ 13 baseURI: "resource://devtools/client/debugger", 14 window, 15 }); 16 globalThis.Debugger = globalThis.browserLoader.require( 17 "devtools/client/debugger/src/main" 18 ); 19 // Expose `require` for the CustomFormatter ESM in order to allow it to load 20 // ObjectInspector, which are still CommonJS modules, via the same BrowserLoader instance. 21 globalThis.browserLoaderRequire = globalThis.browserLoader.require; 22 } catch (e) { 23 dump("Exception happened while loading the debugger:\n"); 24 dump(e + "\n"); 25 dump(e.stack + "\n"); 26 }