New command async_executeScript

Now I’m must create global variable in browser scope;

{
  "Name": "zzzzz",
  "CreationDate": "2020-1-13",
  "Commands": [
    {
      "Command": "executeScript",
      "Target": "return fetch('https://api.github.com/orgs/nodejs').then(x => x.json()).then(x => window.test = x)",
      "Value": ""
    },
    {
      "Command": "executeScript",
      "Target": "return test",
      "Value": "test"
    }
  ]
}

Better

   {
  "Name": "zzzzz",
  "CreationDate": "2020-1-13",
  "Commands": [
    {
      "Command": "async_executeScript",
      "Target": "return await fetch('https://api.github.com/orgs/nodejs').then(x => x.json())",
      "Value": "test"
    }
  ]
}

Can you please explain what this script does? Why is option 2 better than option 1? Just to save one line or do I overlook something? I assume the proposed command is similar to Selenium execute_async_script()?

  1. short writing
  2. next step in macro run when js promise are resolved or rejected == error(red);

Feature added with with V5.5.7 - thanks for the suggestion!

New commands:

Note that this command is not in the command dropdown, you have to add it manually. Reason is, that it is a rather specialized command and should not be confused with the regular executescript.