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

Support Puppeteer argument defaultViewport ? #132

Closed
Zvih opened this issue Aug 23, 2024 · 2 comments
Closed

Support Puppeteer argument defaultViewport ? #132

Zvih opened this issue Aug 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Zvih
Copy link

Zvih commented Aug 23, 2024

I tried setting the general argument "defaultViewport: null" to make the viewport cover the entire page, but it didn't work.

Thanks

...
async getBrowserCF(visible, isIncognito = false) {
let args;

    args = [];
    args.push('--no-sandbox');
    args.push('--disable-setuid-sandbox');
    args.push('--start-maximized');
    args.push('--disable-infobars');
    args.push('--window-position=0,0');
    args.push('--ignore-certificate-errors');
    args.push('--ignore-certificate-errors-spki-list');
    args.push('--disable-gpu');
    args.push('--disable-dev-shm-usage');
    args.push('--password-store=basic');

    if (isIncognito) {
        args.push('--incognito');
    }

    args.push('--window-size=' + this.width + ',' + this.height);

    const {page, browser} = await connect(
        {
            args: args,
            headless: !visible,
            customConfig: {
                defaultViewport: null,
                executablePath: this.executablePath,
                userDataDir: this.userDataDir,
                userAgent: '5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36',
                ignoreHTTPSErrors: true,
                ignoreDefaultArgs: [
                    '--disable-background-networking',
                    //'--enable-features=NetworkService,NetworkServiceInProcess',
                    //'--disable-background-timer-throttling',
                    //'--disable-backgrounding-occluded-windows',
                    //'--disable-breakpad',
                    //'--disable-client-side-phishing-detection',
                    '--disable-component-extensions-with-background-pages',
                    //'--disable-default-apps',
                    //'--disable-dev-shm-usage',
                    '--disable-extensions',
                    // BlinkGenPropertyTrees disabled due to crbug.com/937609
                    //'--disable-features=TranslateUI,BlinkGenPropertyTrees',
                    //'--disable-hang-monitor',
                    //'--disable-ipc-flooding-protection',
                    //'--disable-popup-blocking',
                    //'--disable-prompt-on-repost',
                    //'--disable-renderer-backgrounding',
                    //'--disable-sync',
                    //'--force-color-profile=srgb',
                    //'--metrics-recording-only',
                    //'--no-first-run',
                    //'--enable-automation',
                    //'--password-store=basic',
                    //'--use-mock-keychain',
                ]
            },

            skipTarget: [],
            fingerprint: true,
            turnstile: true,
            connectOption: {},
            fpconfig: {},
        });

    return {page, browser}
}
@mdervisaygan
Copy link
Member

Hello, the project has been updated. Runtime is no longer used, so some issues like this appeared. Thanks for the problem. I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants