I get TypeError: Cannot read property 'enabled' of undefined
both in the anonymous function (on column 21) and the while loop (on column 15):
var enabled = "unknown";
chrome.runtime.sendMessage({request: "Am I enabled?"},
function(response)
{
enabled = response.enabled;
});
while(enabled == "unknown")
{
// wait
}
I don't typically write Javascript, so I'm not sure what I could be doing wrong here. Searching gives me results like var y = null; log(y.property);
which are not this issue at all.