async function getNetworkPermissions (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:network:%'`, [origin], (err, rows) => {
      if (err) return cb(err)

      // convert to array
      var origins = /** @type string[] */([])
      if (rows) {
        rows.forEach(row => {
          if (row.value) origins.push(row.key.split(':').pop())
        })
      }
      cb(null, origins)
    })
  })
}
@param {string} url
@returns {Promise<Array<string>>}