0

In a Chrome add-on:

this works:

var apiKey = e.target.value
chrome.storage.local.set({'IsletJiraApi': apiKey}, function() {});

and this also works:

var obj = {'IsletJiraApi': e.target.value}
chrome.storage.local.set(obj, function() {});

but this does not:

var apiKey = e.target.value
var varName = 'IsletJiraApi'
chrome.storage.local.set({varName: apiKey}, function() {});

Maddeningly, that is what I want so I can abstract to a function storageSet(key, val). This makes no sense to me, anyone know what is going on?

Oliver Williams
  • 5,132
  • 5
  • 31
  • 66

0 Answers0