playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Question] Android automation with other browsers?

Open nicoandmee opened this issue 1 year ago • 1 comments

I noticed launchBrowser can accept a pkg parameter. Is there any limitation that makes it impossible to use other chromium based browser such as Brave? For my use-case, the site in question blacklists traffic from the Chrome browser, but it will work from Brave. I suspect this is because Brave blocks whatever invasive fingerprinting is happening.

However, it doesn't seem to work when I tried. Here is the basic test script I am using.

const { _android: android } = require('playwright');

(async () => {
  // Connect to the device.
  const [device] = await android.devices();
  console.log(`Model: ${device.model()}`);
  console.log(`Serial: ${device.serial()}`);

  await device.shell('am force-stop com.brave.browser');
  const context = await device.launchBrowser({
    pkg: 'com.brave.browser_beta',
  });

  const page = await context.newPage();

  await page.goto('https://www.google.com', { waitUntil: 'networkidle' });
  // Close the device.
  await device.close();
})();

nicoandmee avatar Dec 13 '22 23:12 nicoandmee

If Brave preserve Chromium command line options and CDP it should work. What error do you see?

yury-s avatar Dec 14 '22 01:12 yury-s

We are currently not planning to invest into dedicated support for Brave. If you figure out how to launch it with playwright, please let us know, we can include it into our documentation so that others could benefit too.

yury-s avatar Dec 19 '22 18:12 yury-s

Why was this issue closed?

Thank you for your involvement. This issue was closed due to limited engagement (upvotes/activity), lack of recent activity, and insufficient actionability. To maintain a manageable database, we prioritize issues based on these factors.

If you disagree with this closure, please open a new issue and reference this one. More support or clarity on its necessity may prompt a review. Your understanding and cooperation are appreciated.

pavelfeldman avatar Jun 30 '23 20:06 pavelfeldman