Browser Scripts are located in the hamburger icon in the top left -> "Operations" -> BrowserScripts.
Every user has the default browser scripts automatically imported upon user creation based on which agents are installed.
Anybody can create their own browser scripts and they'll be applied only to that operator. You can also deactivate your own script so that you don't have to delete it, but it will no longer be applied to your output. This deactivates it globally and takes affect when the task is toggled open/close. For individual tasking you can use the speed dial at the bottom of the task and select to "Toggle Browserscript".
If you are an overall admin or the lead of this operation, then you can optionally
Applythe script to the operation. This forces your script to apply to the output of everybody's command in the operation and will override anybody else's script that would otherwise be applied. If you are curious as to whether your script will be in effect or not, the
In Effectcolumn indicates this.
The bottom table shows all of the scripts that are in effect for the current operation and will allow you to view the contents of the scripts even if you don't have permission to modify them.
Register New Scriptto create a new one. This is for one-off scripts you create. If you want to make it permanent across databases and for other operators, then you need to add the script to the corresponding Payload Type's container. More information about that process can be found here: What is Browser Scripting?.
When you're creating a script, the function declaration will always be
taskis a JSON representation of the current task you're processing and
responsesis an array of the responses displayed to the user. This will always be a string. If you actually returned JSON data back, be sure to run
JSON.parseon this to convert it back to a JSON dictionary. So, to access the first response value, you'd say
You should always return a value. It's recommended that you do proper error checking and handling. You can check the status of the task by looking at the
taskvariable and checking the
Even if a browser script is pushed out for a command, its output can be toggled on and off individually.