I created an extension that fetches data from the server, the retrieved data looks like this:
{
"data": [
{
"id": 1,
"name": "Afghanistan"
},
{
"id": 2,
"name": "Albania"
},
{
"id": 3,
"name": "Algeria"
}
],
"status": 200,
"statusText": "OK"
}
The response is stored in data
.
I want to set the array in data
to a variable (argument in extension), the extension use JavaScript events.