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

Update: Video recording not honoring emulated device viewport (iPhone 14 Pro Max) #180

Open
nishitarora2200 opened this issue Nov 20, 2024 · 4 comments

Comments

@nishitarora2200
Copy link

Update:

I have also tried explicitly setting the browser window size to match the device's resolution using the --window-size argument. Here's the updated code:

const browser = await launch({
    args: [
        '--no-sandbox',
        '--disable-setuid-sandbox',
        '--disable-dev-shm-usage',
        '--window-size=430,739' // iPhone 14 Pro Max dimensions
    ],
    // headless: false,
    userDataDir: userDataDir,
    executablePath: getExecutablePath()
});

Despite this, the recorded video still has a width significantly larger than expected. It seems like the recording is ignoring the set window size and/or the emulated device viewport.

Originally posted by @nishitarora2200 in #179 (comment)

@nishitarora2200 nishitarora2200 changed the title Update: Update: Video recording not honoring emulated device viewport (iPhone 14 Pro Max) Nov 20, 2024
@nishitarora2200
Copy link
Author

@SamuelScheit Please update on this

@SamuelScheit
Copy link
Owner

Maybe the banner "This browser is being remote controlled" hides the page content and causes a slightly different video resolution:

to remove this banner add those launch options:

args: [
	"--disable-blink-features=AutomationControlled",
],
ignoreDefaultArgs: ["--enable-automation"],

@nishitarora2200
Copy link
Author

@SamuelScheit Still same output after applying these launch options.

        const browser = await launch({
            args: [
                '--no-sandbox',
                '--disable-setuid-sandbox',
                '--disable-dev-shm-usage',
                '--disable-blink-features=AutomationControlled',
                '--window-size=430,739' // iPhone 14 Pro Max dimensions
            ],
            ignoreDefaultArgs: ["--enable-automation"],
            // headless: false,
            userDataDir: userDataDir,
            executablePath: getExecutablePath()
        });

@nishitarora2200
Copy link
Author

@SamuelScheit Any update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants