network-parent.js (1621B)
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 generateActorSpec, 9 Arg, 10 RetVal, 11 } = require("resource://devtools/shared/protocol.js"); 12 13 const networkParentSpec = generateActorSpec({ 14 typeName: "networkParent", 15 16 methods: { 17 setPersist: { 18 request: { 19 options: Arg(0, "boolean"), 20 }, 21 response: {}, 22 }, 23 setNetworkThrottling: { 24 request: { 25 options: Arg(0, "json"), 26 }, 27 response: {}, 28 }, 29 getNetworkThrottling: { 30 request: {}, 31 response: { 32 state: RetVal("json"), 33 }, 34 }, 35 clearNetworkThrottling: { 36 request: {}, 37 response: {}, 38 }, 39 setSaveRequestAndResponseBodies: { 40 request: { 41 save: Arg(0, "boolean"), 42 }, 43 response: {}, 44 }, 45 setBlockedUrls: { 46 request: { 47 urls: Arg(0, "array:string"), 48 }, 49 }, 50 getBlockedUrls: { 51 request: {}, 52 response: { 53 urls: RetVal("array:string"), 54 }, 55 }, 56 blockRequest: { 57 request: { 58 filters: Arg(0, "json"), 59 }, 60 response: {}, 61 }, 62 unblockRequest: { 63 request: { 64 filters: Arg(0, "json"), 65 }, 66 response: {}, 67 }, 68 override: { 69 request: { 70 url: Arg(0, "string"), 71 path: Arg(1, "string"), 72 }, 73 }, 74 removeOverride: { 75 request: { 76 url: Arg(0, "string"), 77 }, 78 }, 79 }, 80 }); 81 82 exports.networkParentSpec = networkParentSpec;