types.js (2021B)
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 "use strict"; 5 6 const { 7 MESSAGE_SOURCE, 8 MESSAGE_TYPE, 9 MESSAGE_LEVEL, 10 } = require("resource://devtools/client/webconsole/constants.js"); 11 12 exports.ConsoleCommand = function (props) { 13 return Object.assign( 14 { 15 id: null, 16 allowRepeating: false, 17 messageText: null, 18 source: MESSAGE_SOURCE.JAVASCRIPT, 19 type: MESSAGE_TYPE.COMMAND, 20 level: MESSAGE_LEVEL.LOG, 21 groupId: null, 22 indent: 0, 23 private: false, 24 timeStamp: null, 25 }, 26 props 27 ); 28 }; 29 30 exports.ConsoleMessage = function (props) { 31 return Object.assign( 32 { 33 id: null, 34 innerWindowID: null, 35 targetFront: null, 36 allowRepeating: true, 37 source: null, 38 timeStamp: null, 39 type: null, 40 helperType: null, 41 level: null, 42 category: null, 43 messageText: null, 44 parameters: null, 45 repeatId: null, 46 stacktrace: null, 47 frame: null, 48 groupId: null, 49 errorMessageName: null, 50 exceptionDocURL: null, 51 cssSelectors: "", 52 userProvidedStyles: null, 53 notes: null, 54 indent: 0, 55 prefix: "", 56 private: false, 57 chromeContext: false, 58 hasException: false, 59 isPromiseRejection: false, 60 }, 61 props 62 ); 63 }; 64 65 exports.NetworkEventMessage = function (props) { 66 return Object.assign( 67 { 68 id: null, 69 actor: null, 70 targetFront: null, 71 level: MESSAGE_LEVEL.LOG, 72 isXHR: false, 73 request: null, 74 response: null, 75 source: MESSAGE_SOURCE.NETWORK, 76 type: MESSAGE_TYPE.LOG, 77 groupId: null, 78 timeStamp: null, 79 totalTime: null, 80 indent: 0, 81 updates: null, 82 securityState: null, 83 securityInfo: null, 84 requestHeadersFromUploadStream: null, 85 private: false, 86 blockedReason: null, 87 }, 88 props 89 ); 90 };