Hello Samarjeet, thanks for helping! The bug is now yours :) The first thing to do would be to add these new commands in [devtools/server/actors/webconsole/commands.js#7](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole/commands.js#7) Then we need to "register" them, like we do here for the `:help` command [devtools/server/actors/webconsole/utils.js#514-519](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole/utils.js#514-519). This is where we're going to call the actual code to block the URL, and return an object that will indicate to the client that something happened. In order to block/unblock URLS, we need to call the WebConsoleActor's method [devtools/server/actors/webconsole.js#1875-1913](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole.js#1875-1913) . So from the `registerOriginal` method, we'd call `owner.consoleActor.blockRequest(filter)` (and similarly for `unblock`). In the webconsole, when the user calls `:block myurl.*`, we may want to indicate the URL was indeed blocked by putting a message like: `Requests to "myurl.*" are now blocked.". This will be done in [devtools/client/webconsole/actions/input.js#133](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/client/webconsole/actions/input.js#133), by dispatch a `messagesAdd` call with the right message. Then at some point, we'll have to update the netmonitor UI, but let's talk about it when the commands are working. Let me know if you have any questions :)
Bug 1546394 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Hello Samarjeet, thanks for helping! The bug is now yours :) The first thing to do would be to add these new commands in [devtools/server/actors/webconsole/commands.js#7](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole/commands.js#7) Then we need to "register" them, like we do here for the `:help` command [devtools/server/actors/webconsole/utils.js#514-519](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole/utils.js#514-519). This is where we're going to call the actual code to block the URL, and return an object that will indicate to the client that something happened. In order to block/unblock URLS, we need to call the WebConsoleActor's method [devtools/server/actors/webconsole.js#1875-1913](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/server/actors/webconsole.js#1875-1913) . So from the `registerOriginal` method, we'd call `owner.consoleActor.blockRequest(filter)` (and similarly for `unblock`). In the webconsole, when the user calls `:block myurl.*`, we may want to indicate the URL was indeed blocked by putting a message like: `Requests to "myurl.*" are now blocked.`. This will be done in [devtools/client/webconsole/actions/input.js#133](https://searchfox.org/mozilla-central/rev/c2bc259414706ef4be5d13df1344eebb7507a51b/devtools/client/webconsole/actions/input.js#133), by dispatch a `messagesAdd` call with the right message. Then at some point, we'll have to update the netmonitor UI, but let's talk about it when the commands are working. Let me know if you have any questions :)