Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions for management API #78

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}

// 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 @@
}
}

// 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;
}

Check warning on line 253 in tools/lib/feature-query.js

View check run for this annotation

Codecov / codecov/patch

tools/lib/feature-query.js#L252-L253

Added lines #L252 - L253 were not covered by tests

return true;
}
Loading