Skip to content

Commit

Permalink
Merge pull request #78 from GoogleChrome/management-permissions-fix
Browse files Browse the repository at this point in the history
Fix permissions for management API
  • Loading branch information
oliverdunk authored Jul 29, 2024
2 parents 5659a0b + 3afa165 commit de60134
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tools/lib/feature-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ export class FeatureQuery {
}

// Filter (potentially) by channel. Choose the most released channel (e.g., 'stable' over 'beta').
const bestChannel = q.reduce((channel, spec) => mostReleasedChannel(channel, spec.channel), /** @type {chromeTypes.Channel | undefined} */(undefined));
const bestChannelFilter = q.filter(({ channel }) => channel === bestChannel);
const bestChannel = q.reduce((channel, spec) => mostReleasedChannel(channel, spec.channel ?? "stable"), /** @type {chromeTypes.Channel | undefined} */(undefined));
const bestChannelFilter = q.filter(({ channel }) => {
return channel === bestChannel || (bestChannel === "stable" && !channel);
});
if (bestChannelFilter.length === 1) {
return bestChannelFilter[0];
}
Expand Down Expand Up @@ -243,5 +245,12 @@ function basicFilter(f) {
}
}

// An API only exposed to "web_page" contexts (such as the APIs exposed to
// the Chrome Web Store) are unlikely to be ones we want to show in the
// documentation.
if (f.contexts?.length === 1 && f.contexts[0] === "web_page") {
return false;
}

return true;
}

0 comments on commit de60134

Please sign in to comment.