async function getPermissions (url) {
  await setupPromise
  var origin = await extractOrigin(url)
  if (!origin) return null
  return cbPromise(cb => {
    db.all(`SELECT key, value FROM sitedata WHERE origin = ? AND key LIKE 'perm:%'`, [origin], (err, rows) => {
      if (err) return cb(err)

      // convert to a dictionary
      // TODO - pull defaults from browser settings
      var perms = { /* js: true */ }
      if (rows) rows.forEach(row => { perms[row.key.slice('5')] = row.value })
      cb(null, perms)
    })
  })
}
@param {string} url
@returns {Promise<Object>}