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

Emit change event on uploadFile calls #5389

Merged
merged 1 commit into from Mar 12, 2020

Commits on Feb 7, 2020

  1. Emit change event on uploadFile calls

    In puppeteer 1.20.0, the following code emitted an alert:
    ```
    const puppeteer = require('puppeteer');
    
    (async () => {
    	const browser = await puppeteer.launch({args: ['--no-sandbox'], headless: false});
    	const page = (await browser.pages())[0];
    
    	await page.setContent(`
    		<input type=file>
    		<script>
    		document.querySelector('input').addEventListener('change', () => {
    			alert('Uploaded a file');
    		});
    		</script>
    		`);
    	const input = await page.waitForSelector('input[type="file"]');
    	await input.uploadFile(__filename);
    })();
    ```
    
    A bisection yielded 6091a34 as the commit that broke this.
    
    Emitting the change event as well seems to fix the problem.
    phihag committed Feb 7, 2020
    Copy the full SHA
    bcf208d View commit details
    Browse the repository at this point in the history