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

feat: merge user-provided --{disable,enable}-features in args #11152

Merged
merged 5 commits into from Oct 15, 2023

Conversation

thiagowfx
Copy link
Contributor

@thiagowfx thiagowfx commented Oct 13, 2023

Currently user-provided features are completely ignored in args, being overridden with default ones.

Bug: #11072

@thiagowfx thiagowfx force-pushed the thiagowfx/features branch 2 times, most recently from c28874f to d35eab7 Compare October 13, 2023 10:29
@OrKoN
Copy link
Collaborator

OrKoN commented Oct 13, 2023

Currently user-provided features are completely ignored in args, being overridden with default ones.

Is it the case? I would expect that user-provided args override the default ones.

@thiagowfx
Copy link
Contributor Author

thiagowfx commented Oct 13, 2023

Is it the case? I would expect that user-provided args override the default ones.

Yes. If you want to test it out locally, run this script:

#!/usr/bin/env node
import puppeteer from 'puppeteer';

(async () => {
  const browser = await puppeteer.launch({
    devtools: true,
    headless: false,
    args: ['--enable-features=WebBluetoothNewPermissionsBackend'],
  });
  const mainPage = await browser.newPage();
  await mainPage.goto(
    'http://googlechrome.github.io/samples/web-bluetooth/get-devices-async-await.html'
  );
  await mainPage.waitForNetworkIdle();
  await mainPage.waitForDevicePrompt();
})();

Then observe that a log message will appear in the page that says getDevices is not a function.
When the feature is enabled, this message does not appear.

.map(s => {
return s.split(new RegExp(`${flag}` + '=\\s*'))[1]?.trim();
});
return opts.length === 0 ? [] : opts.join(',').split(',');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return opts.length === 0 ? [] : opts.join(',').split(',');

Copy link
Contributor Author

@thiagowfx thiagowfx Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first suggestion was actually wrong. opts was created as an intermediate value. I was having compilation issues otherwise

@thiagowfx
Copy link
Contributor Author

Done

@thiagowfx thiagowfx enabled auto-merge (squash) October 13, 2023 16:09
@thiagowfx thiagowfx enabled auto-merge (squash) October 13, 2023 16:09
@thiagowfx thiagowfx merged commit 2b578e4 into main Oct 15, 2023
52 checks passed
@thiagowfx thiagowfx deleted the thiagowfx/features branch October 15, 2023 14:11
@release-please release-please bot mentioned this pull request Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants