function getRemainingQuota(maxQuota, url, headers = {}) {
  let quota = maxQuota - url.length;
  if (headers instanceof Headers) {
    for (const kv of headers.entries()) {
      quota -= kv[0].length + kv[1].length;
    }
  }
  return quota > 0 ? quota : 0;
}
Calculates max possible remaining quota for a fetchLater request.

Note that this function does NOT know how many fetchLater calls has been made
before calling, nor does it know anything about requests within the URL
origin, and both of them take up quota for the origin.

@param {number} maxQuota The max quota to deduct from. Caller must ensure
                         this is actually used by its owned context.
@param {String} url The URL for a fetchLater call.
@param {Headers=} headers The headers for a fetchLater call.
@return {number} The max possible per-origin quota for fetchLater calls.