--host-package-name
What does --host-package-name do?
When we retrieve the package name within the SDK Runtime, we need to use a bit of a hack to do this by taking advantage of the fact that the pid is the same pid as the application's pid + 10000. see: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/os/Process.java;l=292;drc=47fffdd53115a9af1820e3f89d8108745be4b55d When the render process is created however, it is just a regular isolated process with no particular association so we can't perform the same hack. When creating minidumps, the package name is retrieved from the process meaning the render process minidumps would end up reporting a generic process name not associated with the app. We work around this by feeding through the host package information to the render process when launching it.
Usage
CLILaunch Chrome with --host-package-name using CLI
chrome --host-package-namePuppeteerLaunch Chrome with --host-package-name using Puppeteer
const browser = await puppeteer.launch({
args: ['--host-package-name']
});PlaywrightLaunch Chrome with --host-package-name using Playwright
const browser = await chromium.launch({
args: ['--host-package-name']
});SeleniumLaunch Chrome with --host-package-name using Selenium
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--host-package-name')
driver = webdriver.Chrome(options=options)