sidebar.js (1389B)
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 const { 8 EXTENSION_SIDEBAR_OBJECT_TREEVIEW_UPDATE, 9 EXTENSION_SIDEBAR_EXPRESSION_RESULT_VIEW_UPDATE, 10 EXTENSION_SIDEBAR_PAGE_UPDATE, 11 EXTENSION_SIDEBAR_REMOVE, 12 } = require("resource://devtools/client/inspector/extensions/actions/index.js"); 13 14 module.exports = { 15 /** 16 * Update the sidebar with an object treeview. 17 */ 18 updateObjectTreeView(sidebarId, object) { 19 return { 20 type: EXTENSION_SIDEBAR_OBJECT_TREEVIEW_UPDATE, 21 sidebarId, 22 object, 23 }; 24 }, 25 26 /** 27 * Update the sidebar with an expression result. 28 */ 29 updateExpressionResultView(sidebarId, expressionResult, rootTitle) { 30 return { 31 type: EXTENSION_SIDEBAR_EXPRESSION_RESULT_VIEW_UPDATE, 32 sidebarId, 33 expressionResult, 34 rootTitle, 35 }; 36 }, 37 38 /** 39 * Switch the sidebar into the extension page mode. 40 */ 41 updateExtensionPage(sidebarId, iframeURL) { 42 return { 43 type: EXTENSION_SIDEBAR_PAGE_UPDATE, 44 sidebarId, 45 iframeURL, 46 }; 47 }, 48 49 /** 50 * Remove the extension sidebar from the inspector store. 51 */ 52 removeExtensionSidebar(sidebarId) { 53 return { 54 type: EXTENSION_SIDEBAR_REMOVE, 55 sidebarId, 56 }; 57 }, 58 };