`ignoreDefaultArgs` launch parameter is broken
See original GitHub issueI’m trying to disable default launch arguments however when this parameter is set to True one of two things happen:
browser: Browser = chromium.launch(ignoreDefaultArgs=True)
will break with:
File "/home/user/.local/lib/python3.8/site-packages/playwright/browser_type.py", line 66, in launch
normalize_launch_params(params)
File "/home/user/.local/lib/python3.8/site-packages/playwright/browser_type.py", line 140, in normalize_launch_params
params["env"] = {name: str(value) for [name, value] in params["env"].items()}
KeyError: 'env'
I’ve made a hotfix patch here https://github.com/Granitosaurus/playwright-python/commit/2dc0e107719097e1105e36149a7fe8238c210e38 now the browser launches fine but timesout on launch()
call:
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/playwright/browser_type.py", line 68, in launch
return from_channel(await self._channel.send("launch", params))
File "/home/user/.local/lib/python3.8/site-packages/playwright/connection.py", line 39, in send
result = await callback.future
File "/usr/lib/python3.8/asyncio/futures.py", line 260, in __await__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.8/asyncio/tasks.py", line 349, in __wakeup
future.result()
File "/usr/lib/python3.8/asyncio/futures.py", line 178, in result
raise self._exception
playwright.helper.TimeoutError: Timeout 30000ms exceeded.
=========================== logs ===========================
<launching> /home/user/.cache/ms-playwright/chromium-799411/chrome-linux/chrome
<launched> pid=301672
[err] [301699:301699:0914/061714.839670:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Puppeteer and Chromium launch without flags - Stack Overflow
When ignoreDefaultArgs is set to true, puppeteer won't add any flags to the command line but the ones you set on the args...
Read more >Troubleshooting | Puppeteer
Arguments ' list when launching pupepeteer. In gitlab-ci.yml we need to install some packages to make it possible to launch headless Chrome in...
Read more >BrowserType.LaunchOptions (Playwright - javadoc.io
Dangerous option; use with care. Defaults to false . setIgnoreDefaultArgs. public BrowserType.LaunchOptions setIgnoreDefaultArgs(List<String> ignoreDefaultArgs).
Read more >Launch Browser option not working - Google Groups
Just installed the latest ZAP 2.6 and updated the plugins. Running on Mac OS X 10.12.6. I saw Simon's video on the browser...
Read more >launch([options]) - Grafana k6
Parameter Type Default
args string null
debug boolean false
devtools boolean false
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I thought it might be hanging because some of browser flags were required but I popped the defaults from
playwright
repo here https://github.com/microsoft/playwright/blob/ed3b00efdf0d2e44fc667ade8298ac6d504109bf/src/server/chromium/chromium.ts#L151 and passed them tolaunch(args=)
and unfortunately it’s still timing out on launch:From what I understand here:
You can set the viewport when creating a context: https://playwright.dev/#version=v1.5.2&path=docs%2Fapi.md&q=browsernewcontextoptions--options-viewport-width
So
should work. Is this what you want?