mirror of
				https://github.com/microsoft/playwright.git
				synced 2025-06-26 21:40:17 +00:00 
			
		
		
		
	fix(install): speculative fix for generateChromiumProtocol (#1583)
This commit is contained in:
		
							parent
							
								
									f72b6b4778
								
							
						
					
					
						commit
						6503c83302
					
				| @ -9,9 +9,13 @@ const util = require('util'); | |||||||
| async function generateChromiumProtocol(executablePath) { | async function generateChromiumProtocol(executablePath) { | ||||||
|   const outputPath = path.join(__dirname, '..', '..', 'src', 'chromium', 'protocol.ts'); |   const outputPath = path.join(__dirname, '..', '..', 'src', 'chromium', 'protocol.ts'); | ||||||
|   const playwright = await require('../../index').chromium; |   const playwright = await require('../../index').chromium; | ||||||
|   const args = playwright._defaultArgs(); |   const defaultArgs = playwright._defaultArgs.bind(playwright); | ||||||
|   args.push('--remote-debugging-port=9339'); |   playwright._defaultArgs = (...args) => { | ||||||
|   const browser = await playwright.launch({ executablePath, args, ignoreDefaultArgs: true }); |     const result = defaultArgs(...args); | ||||||
|  |     result.push('--remote-debugging-port=9339'); | ||||||
|  |     return result; | ||||||
|  |   }; | ||||||
|  |   const browser = await playwright.launch({ executablePath }); | ||||||
|   const page = await browser.newPage(); |   const page = await browser.newPage(); | ||||||
|   await page.goto(`http://localhost:9339/json/protocol`); |   await page.goto(`http://localhost:9339/json/protocol`); | ||||||
|   const json = JSON.parse(await page.evaluate(() => document.documentElement.innerText)); |   const json = JSON.parse(await page.evaluate(() => document.documentElement.innerText)); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Dmitry Gozman
						Dmitry Gozman