Skip to content

Commit

Permalink
Fix traverse script when traversing webextensions category (#24107)
Browse files Browse the repository at this point in the history
  • Loading branch information
queengooborg authored Aug 10, 2024
1 parent 2e150d2 commit 3f7ef5f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ export function* iterateFeatures(

if (!browserData) {
if (values.length == 0 || values.includes('null')) {
// Web extensions only allows specific browsers
if (
!(
identifier.startsWith('webextensions.') &&
bcd.browsers[browser].accepts_webextensions
)
) {
continue;
}
yield `${identifier}${i}`;
}
continue;
Expand Down Expand Up @@ -136,7 +145,9 @@ const traverseFeatures = (
*/
const main = (
folders = dataFolders.concat('webextensions'),
browsers: BrowserName[] = Object.keys(bcd.browsers) as BrowserName[],
browsers: BrowserName[] = Object.keys(bcd.browsers).filter(
(b) => bcd.browsers[b].type !== 'server',
) as BrowserName[],
values = ['null', 'true'],
depth = 100,
tag = '',
Expand Down Expand Up @@ -176,7 +187,9 @@ if (esMain(import.meta)) {
describe: 'Filter by a browser. May repeat.',
type: 'array',
nargs: 1,
default: Object.keys(bcd.browsers),
default: Object.keys(bcd.browsers).filter(
(b) => bcd.browsers[b].type !== 'server',
),
})
.option('filter', {
alias: 'f',
Expand Down

0 comments on commit 3f7ef5f

Please sign in to comment.